diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/bun.js/hello-wasi.wasm | bin | 0 -> 131 bytes | |||
-rw-r--r-- | test/bun.js/wasi.test.js | 15 | ||||
-rw-r--r-- | test/bun.js/wasm.test.js | 20 |
3 files changed, 15 insertions, 20 deletions
diff --git a/test/bun.js/hello-wasi.wasm b/test/bun.js/hello-wasi.wasm Binary files differnew file mode 100755 index 000000000..e134bcee4 --- /dev/null +++ b/test/bun.js/hello-wasi.wasm diff --git a/test/bun.js/wasi.test.js b/test/bun.js/wasi.test.js new file mode 100644 index 000000000..f6d8e76f5 --- /dev/null +++ b/test/bun.js/wasi.test.js @@ -0,0 +1,15 @@ +import { spawnSync } from "bun"; +import { expect, it } from "bun:test"; +import { bunEnv } from "bunEnv"; +import { bunExe } from "bunExe"; + +it("Should support printing 'hello world'", () => { + const { stdout, exitCode } = spawnSync({ + cmd: [bunExe(), import.meta.dir + "/hello-wasi.wasm"], + stdout: "pipe", + env: bunEnv, + }); + + expect(stdout.toString()).toEqual("hello world\n"); + expect(exitCode).toBe(0); +}); diff --git a/test/bun.js/wasm.test.js b/test/bun.js/wasm.test.js deleted file mode 100644 index ab88d5beb..000000000 --- a/test/bun.js/wasm.test.js +++ /dev/null @@ -1,20 +0,0 @@ -import { it } from "bun:test"; -// import * as wasm from "./wasm-return-1-test.wasm"; - -// import { readFileSync } from "fs"; - -// it("wasm readFileSync", async () => { -// console.log("here"); -// console.log(wasm.hello()); -// }); - -// it("wasm import", async () => { -// console.log("heyt"); -// try { -// console.log("hi"); -// expect(wasm.hello()).toBe(1); -// } catch (err) { -// console.error(err); -// throw err; -// } -// }); |