From f7e4eb83694aa007a492ef66c28ffbe6a2dae791 Mon Sep 17 00:00:00 2001 From: Ashcon Partovi Date: Tue, 7 Mar 2023 12:22:34 -0800 Subject: Reorganize tests (#2332) --- test/js/third_party/svelte/svelte.test.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/js/third_party/svelte/svelte.test.ts (limited to 'test/js/third_party/svelte/svelte.test.ts') diff --git a/test/js/third_party/svelte/svelte.test.ts b/test/js/third_party/svelte/svelte.test.ts new file mode 100644 index 000000000..44e36cce2 --- /dev/null +++ b/test/js/third_party/svelte/svelte.test.ts @@ -0,0 +1,21 @@ +import { describe, expect, it } from "bun:test"; +import "./bun-loader-svelte"; + +describe("require", () => { + it("SSRs `

Hello world!

` with Svelte", () => { + const { default: App } = require("./hello.svelte"); + const { html } = App.render(); + + expect(html).toBe("

Hello world!

"); + }); +}); + +describe("dynamic import", () => { + it("SSRs `

Hello world!

` with Svelte", async () => { + const { default: App }: any = await import("./hello.svelte"); + + const { html } = App.render(); + + expect(html).toBe("

Hello world!

"); + }); +}); -- cgit v1.2.3