Files
bun.sh/test/js/bun/wasm/wasi.test.js
2025-01-17 22:08:07 -08:00

23 lines
525 B
JavaScript

import { spawnSync } from "bun";
import { expect, it } from "bun:test";
import { bunEnv, bunExe } from "harness";
it("Should support printing 'hello world'", () => {
const { stdout, stderr, exitCode } = spawnSync({
cmd: [bunExe(), import.meta.dir + "/hello-wasi.wasm"],
stdout: "pipe",
stderr: "pipe",
env: bunEnv,
});
expect({
stdout: stdout.toString(),
stderr: stderr.toString(),
exitCode: exitCode,
}).toEqual({
stdout: "hello world\n",
stderr: "",
exitCode: 0,
});
});