mirror of
https://github.com/zebrajr/express.git
synced 2025-12-06 00:19:48 +01:00
increased code coverage of utils.js file (#6386)
Co-authored-by: Sebastian Beltran <bjohansebas@gmail.com>
This commit is contained in:
parent
3dc96995df
commit
5da5a11a49
|
|
@ -25,6 +25,18 @@ describe('utils.etag(body, encoding)', function(){
|
|||
})
|
||||
})
|
||||
|
||||
describe('utils.normalizeType acceptParams method', () => {
|
||||
it('should handle a type with a malformed parameter and break the loop in acceptParams', () => {
|
||||
const result = utils.normalizeType('text/plain;invalid');
|
||||
assert.deepEqual(result,{
|
||||
value: 'text/plain',
|
||||
quality: 1,
|
||||
params: {} // No parameters are added since "invalid" has no "="
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('utils.setCharset(type, charset)', function () {
|
||||
it('should do anything without type', function () {
|
||||
assert.strictEqual(utils.setCharset(), undefined);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user