WebAssembly: run the tests with Node.js 22 - #636
Merged
Merged
Conversation
'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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The first run of the WebAssembly workflow (#635, run 37147555363, second attempt) built the module, then failed at the 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 ofnode --testare file patterns, and the workflow uses Node.js 22. The deployment onmasterfails 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.mdand 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.