Skip to content

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

Description

@webdevelopersrinu

req.is() is documented to accept either a string or an array of types (see the @param {String|Array} types JSDoc in lib/request.js). Passing loose string arguments and single strings is covered by the test suite, but calling req.is() with an actual array — e.g. req.is(['html', 'json']) — has no test.

Running npm run test-cov confirms this: lib/request.js line 273 (the Array.isArray(types) branch) is the only uncovered branch in the file.

I'd like to add test cases for the array form to close this gap. Happy to open a PR.

Coverage output (npm run test-cov):

File % Stmts % Branch % Funcs % Lines Uncovered Line #s
express/lib 98.74 96.16 100 99.61
request.js 100 98.07 100 100 273

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions