Skip to content

refactor(test): run tests via shell script instead of test.js#79

Merged
szegedi merged 1 commit intomainfrom
watson/shell-test-harness
Mar 3, 2026
Merged

refactor(test): run tests via shell script instead of test.js#79
szegedi merged 1 commit intomainfrom
watson/shell-test-harness

Conversation

@watson
Copy link
Copy Markdown
Contributor

@watson watson commented Mar 3, 2026

Description

Replaces the Node.js test runner with a shell script so tests are discovered and run from bash instead of require()-based discovery.

  • Removed test.js — the previous runner that used fs.readdirSync and require('./test/' + file).
  • Added scripts/test.sh — runs top-level test/*.js files and index.js in test subdirectories (skipping wasm), with clear "Running …" output per test.
  • Updated package.json — the test script now runs bash scripts/test.sh instead of node test.

Behavior is unchanged: the same tests run in the same order; only the runner implementation and the yarn test / npm test entrypoint change.

Why this approach

  • Process isolation — Each test file is run in its own node process. A crash or hang in one test doesn’t take down the whole run, and leaks or global state don’t spill between tests.
  • Better failure attribution — The "Running …" line before each test makes it obvious which file failed when something breaks.

Replace the Node.js test runner (test.js) with scripts/test.sh so
tests are discovered and run from bash. The test script runs top-level
test/*.js files and index.js in test subdirectories, skipping wasm.
@watson watson requested review from a team as code owners March 3, 2026 09:30
Copy link
Copy Markdown
Contributor Author

watson commented Mar 3, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@szegedi szegedi merged commit 4398e0d into main Mar 3, 2026
87 of 99 checks passed
@watson watson deleted the watson/shell-test-harness branch March 3, 2026 10:19
tlhunter pushed a commit that referenced this pull request Mar 19, 2026
Replace the Node.js test runner (test.js) with scripts/test.sh so
tests are discovered and run from bash. The test script runs top-level
test/*.js files and index.js in test subdirectories, skipping wasm.
tlhunter pushed a commit that referenced this pull request Mar 20, 2026
Replace the Node.js test runner (test.js) with scripts/test.sh so
tests are discovered and run from bash. The test script runs top-level
test/*.js files and index.js in test subdirectories, skipping wasm.
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.

2 participants