mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
23 lines
525 B
JavaScript
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,
|
|
});
|
|
});
|