Skip to content

Commit

Permalink
fix(test): use non basic header to limit fetch default header
Browse files Browse the repository at this point in the history
  • Loading branch information
Sorikairox committed Aug 14, 2022
1 parent 006156d commit 6bcddf8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions spec/method-param-decorator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class SimpleController {
}

@Get('/lambda')
headerParamWithAttribute(@Header('Accept-Language') acceptHeader: string) {
if (!acceptHeader) return 'No "Accept-Language" header';
headerParamWithAttribute(@Header('New-Header') acceptHeader: string) {
if (!acceptHeader) return 'No "New-Header" header';
return acceptHeader;
}

Expand Down Expand Up @@ -72,7 +72,7 @@ Deno.test('@Header decorator with attribute', async () => {
const res = await fetch(`http://localhost:${port}/lambda`, {
method: 'GET',
headers: {
'Accept-Language': 'en-US',
'New-Header': 'en-US',
},
});
const text = await res.text();
Expand Down Expand Up @@ -104,7 +104,7 @@ Deno.test('@Header decorator with attribute without qualifying header on request
headers: {},
});
const text = await res.text();
assertEquals(text, 'No "Accept-Language" header');
assertEquals(text, 'No "New-Header" header');
await app.close();
});

Expand Down

0 comments on commit 6bcddf8

Please sign in to comment.