Skip to content

Commit 16011f2

Browse files
committed
test(unit): preserve WASI exit status in Node runner
Set returnOnExit to false for the Node WASI instance used by run-test-unit.mjs. In this setup, proc_exit from Ruby can otherwise show up as Symbol(kExitCode) instead of a normal process exit code. Letting Node terminate with the WASI status keeps test failures observable via the runner's exit code.
1 parent 728975b commit 16011f2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ const instantiateNodeWasi = async (rootTestFile) => {
6666
"RUBY_FIBER_MACHINE_STACK_SIZE": String(1024 * 1024 * 20),
6767
},
6868
preopens,
69+
// This test runner initializes WASI and then drives Ruby from JS via
70+
// vm.evalAsync(). In this setup, Node's WASI implementation throws
71+
// Symbol(kExitCode) on proc_exit. Set returnOnExit to false so Node exits
72+
// with the WASI status instead.
73+
returnOnExit: false,
6974
version: "preview1",
7075
});
7176

0 commit comments

Comments
 (0)