fix: json import attribute error in island (#2228)

Fixes https://github.com/denoland/fresh/issues/2214
This commit is contained in:
Marvin Hagemeister
2024-01-10 00:33:38 +01:00
committed by GitHub
parent 15929d37bd
commit 598237d5dd
7 changed files with 46 additions and 13 deletions
+11
View File
@@ -98,6 +98,17 @@ Deno.test("island tests with </script>", async (t) => {
});
});
Deno.test("island with json import", async () => {
await withPage(async (page, address) => {
await page.goto(`${address}/island_json`, {
waitUntil: "networkidle2",
});
const json = await page.$eval("pre", (el) => el.textContent);
assertEquals(JSON.parse(json), { foo: "it works" });
});
});
Deno.test("island with fragment as root", async () => {
await withPage(async (page, address) => {
await page.goto(`${address}/islands/root_fragment`);