fix: only send revive() script when needed (#1825)

This commit is contained in:
Marvin Hagemeister
2023-09-28 10:31:39 +02:00
committed by GitHub
parent 88985fe933
commit 1f2c3073df
2 changed files with 25 additions and 3 deletions
+18
View File
@@ -70,6 +70,24 @@ Deno.test("warns on missing partial", async () => {
);
});
Deno.test("does not include revive() when no island present", async () => {
await withPageName(
"./tests/fixture_partials/main.ts",
async (page, address) => {
const logs: string[] = [];
page.on("pageerror", (msg) => logs.push(msg.message));
const initialUrl = `${address}`;
await page.goto(initialUrl, {
waitUntil: "networkidle2",
});
// Should not error
assertEquals(logs, []);
},
);
});
Deno.test("injects content with island and keeps island instance alive", async () => {
await withPageName(
"./tests/fixture_partials/main.ts",