fix: Set max-len to 120

This commit is contained in:
Joachim Van Herwegen
2020-07-24 14:59:41 +02:00
parent dcff424f58
commit aaba113563
23 changed files with 152 additions and 71 deletions

View File

@@ -25,7 +25,9 @@ describe('AcceptParser', (): void => {
});
it('parses complex Accept headers.', async(): Promise<void> => {
expect(parseAccept('text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4,text/x-dvi; q=0.8; mxb=100000; mxt')).toEqual([
expect(parseAccept(
'text/html;q=0.7, text/html;level=1, text/html;level=2;q=0.4,text/x-dvi; q=0.8; mxb=100000; mxt',
)).toEqual([
{ range: 'text/html', weight: 1, parameters: { mediaType: { level: '1' }, extension: {}}},
{ range: 'text/x-dvi', weight: 0.8, parameters: { mediaType: {}, extension: { mxb: '100000', mxt: '' }}},
{ range: 'text/html', weight: 0.7, parameters: { mediaType: {}, extension: {}}},
@@ -35,7 +37,9 @@ describe('AcceptParser', (): void => {
it('parses Accept headers with double quoted values.', async(): Promise<void> => {
expect(parseAccept('audio/basic; param1="val" ; q=0.5 ;param2="\\\\\\"valid"')).toEqual([
{ range: 'audio/basic', weight: 0.5, parameters: { mediaType: { param1: '"val"' }, extension: { param2: '"\\\\\\"valid"' }}},
{ range: 'audio/basic',
weight: 0.5,
parameters: { mediaType: { param1: '"val"' }, extension: { param2: '"\\\\\\"valid"' }}},
]);
});

View File

@@ -67,7 +67,7 @@ describe('A CompositeAsyncHandler', (): void => {
expect(handleFn).toHaveBeenCalledTimes(1);
});
it('throws the same error as canHandle when calling handleSafe if no handler supports the data.', async(): Promise<void> => {
it('throws the canHandle error when calling handleSafe if the data is not supported.', async(): Promise<void> => {
const handler = new CompositeAsyncHandler([ handlerFalse, handlerFalse ]);
await expect(handler.handleSafe(null)).rejects.toThrow('[Not supported., Not supported.]');