Skip to content

Add test coverage for req.is() with array argument#7380

Closed
atharv-sys32 wants to merge 1 commit into
expressjs:masterfrom
atharv-sys32:test/req-is-array
Closed

Add test coverage for req.is() with array argument#7380
atharv-sys32 wants to merge 1 commit into
expressjs:masterfrom
atharv-sys32:test/req-is-array

Conversation

@atharv-sys32

Copy link
Copy Markdown

Adds test cases for passing an array to req.is(), covering the Array.isArray(types) branch at lib/request.js:273 which was previously the only uncovered branch in the file.

Tests verify:

  • First matching type is returned from the array
  • false when no types match
  • Wildcard patterns work within an array argument (*/json, text/*)

Closes #7348

The Array.isArray(types) branch at lib/request.js:273 was the only
uncovered branch in request.js. Add tests passing an actual array
to req.is() to hit that path.

Closes expressjs#7348
@krzysdz

krzysdz commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Duplicate of #7349

@krzysdz krzysdz marked this as a duplicate of #7349 Jul 16, 2026
@krzysdz krzysdz closed this Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing test coverage for req.is() with an array argument

2 participants