Skip to content

WebAssembly: run the tests with Node.js 22 - #636

Merged
fontanf merged 1 commit into
masterfrom
wasm-ci-test-command
Oct 3, 2026
Merged

fontanf merged 1 commit into
masterfrom
wasm-ci-test-command

Conversation

@fontanf

@fontanf fontanf commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Problem

The first run of the WebAssembly workflow (#635, run 37147555363, second attempt) built the module, then failed at the tests:

# Error: Cannot find module '/home/runner/work/packingsolver/packingsolver/wasm/tests'

node --test wasm/tests/ runs the tests of a directory with Node.js 18, which I had tested locally. Since Node.js 21, the arguments of node --test are file patterns, and the workflow uses Node.js 22. The deployment on master fails at the same step, so nothing is deployed until this is merged.

Fix

Pass the test files, expanded by the shell: node --test wasm/tests/*.test.js wasm/tests/*.test.mjs. That works with every version. Updated in the workflow, wasm/README.md and the comments of the test files.

Testing

All 99 tests pass with this command with Node.js 18.19 and 24.19 (the one bundled with Emscripten). Node.js 24 also reproduces the error with the directory.

'node --test wasm/tests/' only runs a directory with Node.js 18: since
Node.js 21, the arguments of 'node --test' are file patterns, and the
workflow, which uses Node.js 22, failed with "Cannot find module
'.../wasm/tests'". Pass the test files instead, which works with both.
@fontanf
fontanf merged commit 51317d9 into master Oct 3, 2026
2 of 5 checks passed
@fontanf
fontanf deleted the wasm-ci-test-command branch October 3, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant