Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down