Skip to content

test: migrate test suite to Node.js built-in test runner#590

Merged
alexander-akait merged 5 commits into
mainfrom
claude/rewrite-tests-node-runner-LNhhS
May 19, 2026
Merged

test: migrate test suite to Node.js built-in test runner#590
alexander-akait merged 5 commits into
mainfrom
claude/rewrite-tests-node-runner-LNhhS

Conversation

@alexander-akait

Copy link
Copy Markdown
Member

Replace Jest with Node's built-in test runner (node:test and
node:assert) following the same pattern used by webpack-contrib/sass-loader.

Changes:

  • Convert all test files to native ESM using node:test and node:assert
  • Add test/package.json with type: module so test files run as ESM
  • Add test/setup-snapshots.js to keep snapshots in test/__snapshots__/
  • Rewrite helpers as native ESM (use fileURLToPath/createRequire)
  • Rename CJS fixtures and the test loader to .cjs
  • Test against the built loader in dist/cjs.js (pretest runs build)
  • Regenerate snapshots in node:test format
  • Bump minimum Node.js to >= 22.11.0
  • Remove jest and babel-jest from devDependencies

@linux-foundation-easycla

linux-foundation-easycla Bot commented May 19, 2026

Copy link
Copy Markdown

CLA Not Signed

claude added 2 commits May 19, 2026 20:55
Replace Jest with Node's built-in test runner (`node:test` and
`node:assert`) following the same pattern used by webpack-contrib/sass-loader.

Changes:
- Convert all test files to native ESM using `node:test` and `node:assert`
- Add `test/package.json` with `type: module` so test files run as ESM
- Add `test/setup-snapshots.js` to keep snapshots in `test/__snapshots__/`
- Rewrite helpers as native ESM (use `fileURLToPath`/`createRequire`)
- Rename CJS fixtures and the test loader to `.cjs`
- Test against the built loader in `dist/cjs.js` (`pretest` runs build)
- Regenerate snapshots in node:test format
- Bump minimum Node.js to `>= 22.11.0`
- Remove `jest` and `babel-jest` from devDependencies
@alexander-akait alexander-akait force-pushed the claude/rewrite-tests-node-runner-LNhhS branch from 027161b to 9061604 Compare May 19, 2026 21:05
claude added 3 commits May 19, 2026 21:10
The test runner migration bumped the engines requirement to
Node.js >= 22.11.0, so older Node versions can no longer run the
suite. The `--ci` flag was specific to Jest and is not understood
by `node:test`.
@alexander-akait alexander-akait merged commit 6adf9e1 into main May 19, 2026
11 of 12 checks passed
@alexander-akait alexander-akait deleted the claude/rewrite-tests-node-runner-LNhhS branch May 19, 2026 22:19
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