Skip to content

fix(middleware-code-coverage): Drop Express coupling - #591

Merged
matz3 merged 1 commit into
mainfrom
connect-compatibility
Aug 18, 2026
Merged

fix(middleware-code-coverage): Drop Express coupling#591
matz3 merged 1 commit into
mainfrom
connect-compatibility

Conversation

@matz3

@matz3 matz3 commented Aug 17, 2026

Copy link
Copy Markdown
Member

Add an integration test that mounts the middleware on a plain connect() app (no ui5 serve, no Express) to prove it depends only on the sanctioned Node.js http surface, and rewrite the middleware to satisfy it:

  • res.json(...) / res.err(...) -> res.writeHead + res.end(JSON.stringify(...))
  • res.type(".js") -> res.setHeader("Content-Type", "text/javascript")
  • req.path / req.query -> new URL(req.url, "http://localhost")

req.body is retained (populated by body-parser).

Add an integration test that mounts the middleware on a plain connect() app
(no ui5 serve, no Express) to prove it depends only on the sanctioned Node.js
http surface, and rewrite the middleware to satisfy it:

- res.json(...) / res.err(...) -> res.writeHead + res.end(JSON.stringify(...))
- res.type(".js")              -> res.setHeader("Content-Type", "text/javascript")
- req.path / req.query          -> new URL(req.url, "http://localhost")

req.body is retained (populated by body-parser).
@matz3
matz3 requested a review from a team August 17, 2026 13:26
@matz3
matz3 merged commit a1ef5af into main Aug 18, 2026
18 checks passed
@matz3
matz3 deleted the connect-compatibility branch August 18, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants