chore(deps): update express to v5 & jest deprecations #1502
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Closes #1492
The changes in this PR include the following :
express
to v5.0.0express
related types packagesMigrating to Express 5
Some highlights
res.send(obj, status)
becomesres.status(status).send(obj)
.🧑💻 Code Updates 🧑💻
src/App.ts
Adjusted the syntax (basically just the brackets) of
app.get
to be as expected. I was thinking that I needed to change the syntax ofres.send(...
tores.status(status).send(...
(based on the v5.0.0 changes) but it is not needed. I think it is because we do not usestatus
.AbstractControllers.spec.ts
It does not expect any return values
I just changed it so it does not return the "Great success!" message and just console.log's it.
testTools.ts and util.ts
I get a floating-promises error from the linter
so I just added the
async - await
syntax to the middleware calls.Jest Deprecations
Replaced the following matchers :
with the corresponding ones :
based on this PR.
When running
yarn upgrade-interactive
it suggests as latest version the^4.21.0
for theexpress
package, even though currently the package is in^5.0.0
. This feels a bit counterintuitive but I think it is because express 5.0.0 is not yet the default one.Checks
yarn build
yarn lint --fix
yarn test
yarn test:latest-e2e-tests
yarn test:historical-e2e-tests