Skip to content

Commit 4a11dba

Browse files
Merge pull request #632 from ledsun/fix/test-unit-wasi-exit-code
test:unit: keep Node WASI exit status instead of Symbol(kExitCode)
2 parents 9fa8ee5 + 16011f2 commit 4a11dba

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)