Skip to content

Commit

Permalink
Upgrading to Express v5
Browse files Browse the repository at this point in the history
  • Loading branch information
lreading committed Dec 27, 2024
1 parent cd1eeff commit 7c86970
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 91 deletions.
143 changes: 58 additions & 85 deletions td.server/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion td.server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"axios": "^1.7.7",
"bitbucket": "^2.11.0",
"dotenv": "^16.0.3",
"express": "^4.20.0",
"express": "^4.21.2",
"express-rate-limit": "^7.4.0",
"googleapis": "^144.0.0",
"helmet": "^6.0.1",
Expand Down
12 changes: 7 additions & 5 deletions td.server/test/config/parsers.config.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ describe('config/parsers.config.js request parser', () => {
it('should parse the json in the request body', (done) => {
const id = 'id';
const collection = ['1', '2', '3'];
const nested = {n1: '1', n2: '2'};
const nested = {n1: '1', n3: '2'};
const body = {id: id, collection: collection, nested: nested};
const bodyText = JSON.stringify(body);

app.post('/', function(req, res) {
expect(req.body).to.deep.eq(body);
res.status(200);
res.send('result');
res.status(200)
.set('Content-Type', 'text/plain; charset=utf-8')
.send('result');
});

request(app)
Expand All @@ -45,8 +46,9 @@ describe('config/parsers.config.js request parser', () => {
expect(req.body.collection[2]).to.eq(collection[2]);
expect(req.body.nested.n1).to.eq(nested.n1);
expect(req.body.nested.n2).to.eq(nested.n2);
res.status(200);
res.send('result');
res.status(200)
.set('Content-Type', 'text/plain; charset=utf-8')
.send('result');
});

request(app)
Expand Down

0 comments on commit 7c86970

Please sign in to comment.