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 |
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):