summaryrefslogtreecommitdiff
path: root/packages/integrations/deno/test
diff options
context:
space:
mode:
authorGravatar wulinsheng123 <409187100@qq.com> 2023-02-16 23:16:07 +0800
committerGravatar GitHub <noreply@github.com> 2023-02-16 09:16:07 -0600
commitef5cea4dc5c4ffa33bd57ea0886e6912afb24fec (patch)
tree681c11211a396616ac48fe0cf10fcbca96b521db /packages/integrations/deno/test
parent0049fda62fa8650a0d250adb00a2c5d82679aeaf (diff)
downloadastro-ef5cea4dc5c4ffa33bd57ea0886e6912afb24fec.tar.gz
astro-ef5cea4dc5c4ffa33bd57ea0886e6912afb24fec.tar.zst
astro-ef5cea4dc5c4ffa33bd57ea0886e6912afb24fec.zip
Deno fix #6131 (#6248)
* fix: #6131 * fix: delete * update code * fix: fix bug * add some tests * fix route error * delete comment * delete trash code --------- Co-authored-by: wuls <linsheng.wu@beantechs.com>
Diffstat (limited to 'packages/integrations/deno/test')
-rw-r--r--packages/integrations/deno/test/basics.test.ts21
-rw-r--r--packages/integrations/deno/test/fixtures/basics/src/pages/perendering.astro9
2 files changed, 30 insertions, 0 deletions
diff --git a/packages/integrations/deno/test/basics.test.ts b/packages/integrations/deno/test/basics.test.ts
index d1f8907cb..e61dbd3f7 100644
--- a/packages/integrations/deno/test/basics.test.ts
+++ b/packages/integrations/deno/test/basics.test.ts
@@ -143,3 +143,24 @@ Deno.test({
sanitizeResources: false,
sanitizeOps: false,
});
+
+Deno.test({
+ name: 'perendering',
+ permissions: defaultTestPermissions,
+ async fn() {
+ await startApp(async (baseUrl: URL) => {
+ const resp = await fetch(new URL('perendering', baseUrl));
+ assertEquals(resp.status, 200);
+
+
+ const html = await resp.text();
+ assert(html);
+
+ const doc = new DOMParser().parseFromString(html, `text/html`);
+ const h1 = doc!.querySelector('h1');
+ assertEquals(h1!.innerText, 'test');
+ });
+ },
+ sanitizeResources: false,
+ sanitizeOps: false,
+});
diff --git a/packages/integrations/deno/test/fixtures/basics/src/pages/perendering.astro b/packages/integrations/deno/test/fixtures/basics/src/pages/perendering.astro
new file mode 100644
index 000000000..ca317d38d
--- /dev/null
+++ b/packages/integrations/deno/test/fixtures/basics/src/pages/perendering.astro
@@ -0,0 +1,9 @@
+---
+export const prerender = true;
+---
+
+<html>
+<body>
+ <h1>test</h1>
+</body>
+</html>