Skip to content

Commit

Permalink
chore: add test for island updater (#2484)
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinhagemeister authored Jun 3, 2024
1 parent e007597 commit 848834e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions update/src/update_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";`,
);
});
});

0 comments on commit 848834e

Please sign in to comment.