chore: add test for island updater (#2484)

This commit is contained in:
Marvin Hagemeister
2024-06-03 17:25:41 +02:00
committed by GitHub
parent e007597ff3
commit 848834e6a7
+16
View File
@@ -665,3 +665,19 @@ Deno.test("update - 1.x remove reference comments", async () => {
expect(files["/routes/main.ts"]).toEqual("");
});
});
Deno.test("update - island files", async () => {
await withTmpDir(async (dir) => {
await writeFiles(dir, {
"/deno.json": `{}`,
"/islands/foo.tsx": `import { IS_BROWSER } from "$fresh/runtime.ts";`,
});
await updateProject(dir);
const files = await readFiles(dir);
expect(files["/islands/foo.tsx"]).toEqual(
`import { IS_BROWSER } from "@fresh/core/runtime";`,
);
});
});