| description |
Test commands, organization, and patterns |
| paths |
|
npm run build # Always build first
npm run test:22 # Test with Node.js 22
npm run test:host # Test with host Node.js version
node test/test.js node22 no-npm test-50-* # Run specific test pattern
- Tests live in
test/test-XX-descriptive-name/ directories (XX = execution order).
- Each test has a
main.js entry point using utilities from test/utils.js.
test-79-npm/ — npm package integration tests (only-npm).
test-42-fetch-all/ — verifies patches exist for all Node.js versions.
- Create
test/test-XX-descriptive-name/ with a main.js
- Use
utils.pkg.sync() to invoke pkg
- Verify outputs, clean up with
utils.filesAfter()
Test artifacts (*.exe, *-linux, *-macos, *-win.exe) must be cleaned from test directories before committing.