aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets
diff options
context:
space:
mode:
Diffstat (limited to 'integration/bunjs-only-snippets')
-rw-r--r--integration/bunjs-only-snippets/transpiler.test.js22
1 files changed, 19 insertions, 3 deletions
diff --git a/integration/bunjs-only-snippets/transpiler.test.js b/integration/bunjs-only-snippets/transpiler.test.js
index 2c59c10b8..0a33954c5 100644
--- a/integration/bunjs-only-snippets/transpiler.test.js
+++ b/integration/bunjs-only-snippets/transpiler.test.js
@@ -42,9 +42,25 @@ describe("Bun.Transpiler", () => {
it("reports all export names", () => {
const { imports, exports } = transpiler.scan(code);
- expect(exports[0]).toBe("loader");
- expect(exports[1]).toBe("action");
- expect(exports[2]).toBe("default");
+ expect(exports[0]).toBe("action");
+ expect(exports[2]).toBe("loader");
+ expect(exports[1]).toBe("default");
+
+ expect(exports).toHaveLength(3);
+ });
+ });
+
+ describe("transform", () => {
+ it("removes types", () => {
+ const out = transpiler.transform(code);
+ expect(out.includes("ActionFunction")).toBe(false);
+ expect(out.includes("LoaderFunction")).toBe(false);
+
+ const { exports } = transpiler.scan(out);
+
+ expect(exports[0]).toBe("action");
+ expect(exports[2]).toBe("loader");
+ expect(exports[1]).toBe("default");
expect(exports).toHaveLength(3);
});
});