Skip to content

Commit af70f2d

Browse files
committed
test: add local wasm fixture
1 parent f70163c commit af70f2d

4 files changed

Lines changed: 8 additions & 2 deletions

File tree

test/fixture/server/routes/wasm/dynamic-import.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { defineLazyEventHandler, defineHandler } from "nitro/h3";
22

33
export default defineLazyEventHandler(async () => {
44
// @ts-ignore
5-
const { sum } = await import("unwasm/examples/sum.wasm").then((r) => r.default());
5+
const { sum } = await import("./sum.wasm").then((r) => r.default());
66
return defineHandler(() => {
77
return `2+3=${sum(2, 3)}`;
88
});

test/fixture/server/routes/wasm/static-import.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineHandler, defineLazyEventHandler } from "nitro/h3";
22

33
// @ts-ignore
4-
import init, { sum } from "unwasm/examples/sum.wasm";
4+
import init, { sum } from "./sum.wasm";
55

66
export default defineLazyEventHandler(async () => {
77
// @ts-ignore
41 Bytes
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
;; Text source of `sum.wasm` (kept for reference, not part of the build).
2+
(module
3+
(func (export "sum") (param i32 i32) (result i32)
4+
local.get 0
5+
local.get 1
6+
i32.add))

0 commit comments

Comments
 (0)