Skip to content

test: add coverage for req.is() with array argument#7349

Open
roshnithakor07 wants to merge 1 commit into
expressjs:masterfrom
roshnithakor07:test/req-is-array-coverage
Open

test: add coverage for req.is() with array argument#7349
roshnithakor07 wants to merge 1 commit into
expressjs:masterfrom
roshnithakor07:test/req-is-array-coverage

Conversation

@roshnithakor07

Copy link
Copy Markdown

Closes #7348

Adds test coverage for req.is() when called with an array
argument directly (e.g. req.is(['html', 'json'])), which was
previously untested and showed up as an uncovered branch on
lib/request.js line 273.

Before:

  • request.js branch coverage: 98.07%, line 273 uncovered

After:

  • request.js: 100% across all metrics

@Ziiyodullayevv Ziiyodullayevv left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good test coverage addition. Testing req.is() with array arguments ensures the method works correctly for content-type matching with multiple types.

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.

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

2 participants