From 848834e6a7d0eeead2ba78e94ddca2ed41fed55c Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Mon, 3 Jun 2024 17:25:41 +0200 Subject: [PATCH] chore: add test for island updater (#2484) --- update/src/update_test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/update/src/update_test.ts b/update/src/update_test.ts index 9cb42574..ce9e02da 100644 --- a/update/src/update_test.ts +++ b/update/src/update_test.ts @@ -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";`, + ); + }); +});