Skip to content

Commit

Permalink
Add Failing Test For Deno Custom 404 Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
zicklag committed Aug 31, 2022
1 parent 6f1fbd8 commit a1454d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/integrations/deno/test/basics.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,21 @@ Deno.test({
},
});

Deno.test({
name: 'Custom 404',
async fn() {
await startApp(async () => {
const resp = await fetch('http://127.0.0.1:8085/this-does-not-exist');
assertEquals(resp.status, 404);
const html = await resp.text();
assert(html);
const doc = new DOMParser().parseFromString(html, `text/html`);
const header = doc.querySelector('#custom-404');
assert(header, 'displays custom 404');
});
},
});

Deno.test({
name: 'Loads style assets',
async fn() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1 id="custom-404">Custom 404 Page</h1>

0 comments on commit a1454d7

Please sign in to comment.