From 16011f29ba3278b7d47656a1334f41d9bc93b80b Mon Sep 17 00:00:00 2001 From: "shigeru.nakajima" Date: Mon, 23 Mar 2026 22:42:38 +0900 Subject: [PATCH] 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. --- packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs b/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs index ffef02c7d..bb86023dd 100755 --- a/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs +++ b/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs @@ -66,6 +66,11 @@ const instantiateNodeWasi = async (rootTestFile) => { "RUBY_FIBER_MACHINE_STACK_SIZE": String(1024 * 1024 * 20), }, preopens, + // This test runner initializes WASI and then drives Ruby from JS via + // vm.evalAsync(). In this setup, Node's WASI implementation throws + // Symbol(kExitCode) on proc_exit. Set returnOnExit to false so Node exits + // with the WASI status instead. + returnOnExit: false, version: "preview1", });