build!: migrate the test suite to node:test and require Node.js >= 22.12.0 - #309
Merged
Conversation
….12.0 The suite runs on the runner Node ships. Assertions become `node:assert`, `describe`/`it` and the lifecycle hooks come from `node:test`, and coverage comes from `--experimental-test-coverage` written as lcov for codecov. Node.js 20 is end-of-life, so the floor moves to the oldest maintained LTS. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy
Git checks the fixture out with CRLF on Windows and ESLint keeps it, which jest's snapshot serializer used to normalize away. Drop the eslint version from the test matrix as well: it multiplied every OS and Node.js combination by two for what the dedicated linters job already covers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy
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.
Summary
The suite runs on the test runner Node ships, so
jest,@jest/globalsandjest.config.jsgo away.describe/itand the lifecycle hooks come fromnode:test, assertions fromnode:assert/strict, and coverage from--experimental-test-coveragewritten as lcov for codecov. Node.js 20 is end-of-life, soengines.nodemoves to the oldest maintained LTS,>= 22.12.0.Nothing in
src/changed. Four things in the diff are worth a reviewer's attention:assert.rejects(promise, "text")reads the string as the assertion's own message, not as a matcher. Every.rejects.toThrow("…")and.toThrow("…")became a regex instead, so those 11 assertions still check what they used to rather than passing on any rejection at all.fs-extra's named exports do not survive native ESM interop —copySync/removeSyncarenode:fs'scpSync/rmSync, sofs-extraand@types/fs-extraare gone too.eslint-config-webpackscopes its test-file rule relaxations behind havingjestas a dependency, so removing jest turnedid-length,jsdoc/require-jsdocand then/no-unsupported-features/*rules back on fortest/**.eslint.config.mjsnow carries that same set itself.utilsmockednode:fsthroughjest.unstable_mockModule. It stats real fixture paths now instead, which is what the mock was standing in for.What kind of change does this PR introduce?
build (breaking).
Did you add tests for your changes?
No new tests — the suite is the subject of the change. All 60 files are ported: 124 passing and the 2 ESLint 10 eslintrc suites skipped, the same counts as on
main, with coverage at 99.33% of lines.Does this PR introduce a breaking change?
Yes. Node.js 20 is no longer supported; the minimum is
>= 22.12.0. Node 20 reached end-of-life in April 2026, and the CI matrix drops to 22.x and 24.x.If relevant, what needs to be documented once your changes are merged or what have you already documented?
The README's support note names the Node.js requirement. A changeset is included marking this a major.
Use of AI
Written with Claude Code, driven interactively. I asked for the migration and the version bump; Claude did the conversion, found the
assert.rejectsmessage-vs-matcher trap and the jest-gated lint config, and reported both. I reviewed the result.🤖 Generated with Claude Code
https://claude.ai/code/session_01GzZci4NQeiqwdrVfd7dGXy
Generated by Claude Code