From a1454d75819218381db5676765fdd5c6a1fc5666 Mon Sep 17 00:00:00 2001 From: Zicklag Date: Tue, 30 Aug 2022 19:01:17 -0500 Subject: [PATCH] Add Failing Test For Deno Custom 404 Pages --- packages/integrations/deno/test/basics.test.js | 15 +++++++++++++++ .../deno/test/fixtures/basics/src/pages/404.astro | 1 + 2 files changed, 16 insertions(+) create mode 100644 packages/integrations/deno/test/fixtures/basics/src/pages/404.astro diff --git a/packages/integrations/deno/test/basics.test.js b/packages/integrations/deno/test/basics.test.js index aee9dd1f355b..c883fc8aebc5 100644 --- a/packages/integrations/deno/test/basics.test.js +++ b/packages/integrations/deno/test/basics.test.js @@ -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() { diff --git a/packages/integrations/deno/test/fixtures/basics/src/pages/404.astro b/packages/integrations/deno/test/fixtures/basics/src/pages/404.astro new file mode 100644 index 000000000000..cc1c5761e29e --- /dev/null +++ b/packages/integrations/deno/test/fixtures/basics/src/pages/404.astro @@ -0,0 +1 @@ +

Custom 404 Page