test: prevent test middleware from crashing on GET requests in Express 5#1167
Draft
ericcrosson-bitgo wants to merge 6 commits into
Draft
Conversation
Bumps [express](https://github.com/expressjs/express) and [@types/express](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/express). These dependencies needed to be updated together. Updates `express` from 4.21.2 to 5.2.1 - [Release notes](https://github.com/expressjs/express/releases) - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - [Commits](expressjs/express@4.21.2...v5.2.1) Updates `@types/express` from 4.17.21 to 5.0.6 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/express) --- updated-dependencies: - dependency-name: "@types/express" dependency-version: 5.0.6 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: express dependency-version: 5.2.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Express 5 upgrades req.body to undefined by default on GET/empty body requests. Our test appMiddleware previously assumed req.body was always an object, causing TypeError on GET routes during test runs. We add a defensive check for req.body presence so tests can pass when upgrading to Express 5 dependencies. Ticket: AI-782
…Dependencies Declares express and @types/express as peerDependencies supporting both v4 and v5 ranges, and adds them to devDependencies to preserve local development. Ticket: AI-782
…dencies Declares express and @types/express as peerDependencies supporting both v4 and v5 ranges, and adds express to devDependencies to preserve local development. Ticket: AI-782
Regenerates lockfile structure following the shift of express and @types/express to peerDependencies and devDependencies in workspaces. Ticket: AI-782
Adds express-version (4 and 5) to the GitHub Actions workflow matrix, and installs the corresponding target version in the workspaces before test execution. Ticket: AI-782
ericcrosson-bitgo
force-pushed
the
ericcrosson/ai-782-fix-express-and-typesexpress-dependency-bump-test
branch
from
July 24, 2026 16:18
353c176 to
e11b1ba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Updates
appMiddlewareinexpress-wrapperandtyped-express-routertest suites to check ifreq.bodyis defined before setting theappMiddlewareRanflag.In Express 5,
req.bodydefaults toundefinedon requests without a body (such asGETrequests), which caused these test suites to throw aTypeErrorand fail.Closes Ticket: AI-782