diff options
author | 2023-01-28 23:23:26 -0800 | |
---|---|---|
committer | 2023-01-28 23:23:26 -0800 | |
commit | f087388ebc6314c2852d553f4f4ea3074369dfbe (patch) | |
tree | 935a0c205b3eccca29f3bcc5e3db18f7fdc4469d /test/bun.js/wasi.test.js | |
parent | 48eb0c12ab2c568d7ff706c2b0a6616d428032c8 (diff) | |
download | bun-f087388ebc6314c2852d553f4f4ea3074369dfbe.tar.gz bun-f087388ebc6314c2852d553f4f4ea3074369dfbe.tar.zst bun-f087388ebc6314c2852d553f4f4ea3074369dfbe.zip |
Support running WASI (WebAssembly) files using `bun run` (#1929)
* another micro bench
* Support running WASI
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'test/bun.js/wasi.test.js')
-rw-r--r-- | test/bun.js/wasi.test.js | 15 |
1 files changed, 15 insertions, 0 deletions
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); +}); |