File tree Expand file tree Collapse file tree 5 files changed +16
-5
lines changed
packages/npm-packages/ruby-wasm-wasi Expand file tree Collapse file tree 5 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 4040 "license" : " MIT" ,
4141 "scripts" : {
4242 "test:run" : " npm run test:unit && npm run test:vitest -- --run && npm run test:e2e" ,
43- "test:vitest" : " node ../../../node_modules/.bin/ vitest ./test/" ,
43+ "test:vitest" : " vitest ./test/" ,
4444 "test:unit" : " ./tools/run-test-unit.mjs" ,
4545 "test:e2e" : " playwright install && npm run test:e2e:examples && npm run test:e2e:integrations" ,
4646 "test:e2e:examples" : " playwright test -c test-e2e/playwright.examples.config.ts" ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export const DefaultRubyVM = async (
55 rubyModule : WebAssembly . Module ,
66 options : { env ?: Record < string , string > | undefined } = { } ,
77) => {
8- const wasi = new WASI ( { env : options . env , version : "preview1" } ) ;
8+ const wasi = new WASI ( { env : options . env , version : "preview1" , returnOnExit : true } ) ;
99 const vm = new RubyVM ( ) ;
1010 const imports = {
1111 wasi_snapshot_preview1 : wasi . wasiImport ,
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ const initModuleRubyVM = async ({ suppressStderr } = { suppressStderr: false })
3131 stderrFd = devNullFd . fd ;
3232 }
3333 const wasi = new WASI ( {
34+ version : "preview1" ,
35+ returnOnExit : true ,
3436 args : [ "ruby.wasm" ] . concat ( process . argv . slice ( 2 ) ) ,
3537 stderr : stderrFd ,
3638 preopens,
Original file line number Diff line number Diff line change @@ -6,7 +6,10 @@ import { DefaultRubyVM } from "../src/node";
66import { describe , test , expect } from "vitest"
77
88const initRubyVM = async ( rubyModule , args ) => {
9- const wasi = new WASI ( ) ;
9+ const wasi = new WASI ( {
10+ version : "preview1" ,
11+ returnOnExit : true ,
12+ } ) ;
1013 const vm = new RubyVM ( ) ;
1114 const imports = {
1215 wasi_snapshot_preview1 : wasi . wasiImport ,
Original file line number Diff line number Diff line change @@ -119,7 +119,10 @@ eval:11:in \`<main>'`
119119 expect ( throwError ) . toThrowError ( expectedBacktrace ) ;
120120 } ) ;
121121
122- test ( "exception while formatting exception backtrace" , async ( ) => {
122+ test . skipIf (
123+ // TODO(katei): Investigate further why this test "crashes" on Node.js 22.
124+ process . versions . node . startsWith ( "22." ) && ! process . env . ENABLE_COMPONENT_TESTS ,
125+ ) ( "exception while formatting exception backtrace" , async ( ) => {
123126 const vm = await initRubyVM ( { suppressStderr : true } ) ;
124127 const throwError = ( ) => {
125128 vm . eval ( `
@@ -163,7 +166,10 @@ eval:11:in \`<main>'`
163166 } ) . toThrowError ( "Ruby APIs that may rewind the VM stack are prohibited" ) ;
164167 } ) ;
165168
166- test . each ( [ `JS::RubyVM.evalAsync("")` ] ) (
169+ test . skipIf (
170+ // TODO(katei): Investigate further why this test "crashes" on Node.js 22.
171+ process . versions . node . startsWith ( "22." ) && ! process . env . ENABLE_COMPONENT_TESTS ,
172+ ) . each ( [ `JS::RubyVM.evalAsync("")` ] ) (
167173 "nested VM rewinding operation should throw fatal error (async)" ,
168174 async ( code ) => {
169175 // Supress bugreport message triggered by the fatal error inside evalAsync
You can’t perform that action at this time.
0 commit comments