Skip to content

Commit

Permalink
Update handler.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mqxx committed Oct 17, 2023
1 parent 9266640 commit a8d1ab9
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/request/handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ Deno.test(
const request = new Request('http://localhost:80/testdir');

assertEquals(
handler(request).headers.get('Content-Type'),
handler(
request,
'./',
'index.html',
false
).headers.get('Content-Type'),
'text/html'
);
}
Expand All @@ -23,7 +28,11 @@ Deno.test(
const request = new Request('http://localhost:80/testdir/file.js');

assertEquals(
requestHandler(request).headers.get('Content-Type'),
handler(
request,
'./',
'index.html',
false).headers.get('Content-Type'),
'application/javascript'
);
}
Expand All @@ -34,7 +43,12 @@ Deno.test(
const request = new Request('http://localhost:80/testdir/file.unknownExtension');

assertEquals(
requestHandler(request).headers.get('Content-Type'),
handler(
request,
'./',
'index.html',
false
).headers.get('Content-Type'),
'text/plain'
);
}
Expand Down

0 comments on commit a8d1ab9

Please sign in to comment.