Skip to content

refactor: rewrite all tests to use native node:test#223

Merged
zkochan merged 2 commits intomainfrom
node-test
Mar 11, 2026
Merged

refactor: rewrite all tests to use native node:test#223
zkochan merged 2 commits intomainfrom
node-test

Conversation

@zkochan
Copy link
Copy Markdown
Owner

@zkochan zkochan commented Mar 11, 2026

Summary

  • Replaced tape, jest, and ts-jest with Node.js built-in node:test runner and node:assert module across all 28 packages
  • TypeScript tests use node --experimental-strip-types --test
  • Removed tape, jest, ts-jest, @types/jest, @types/tape, ts-node from devDependencies
  • Net reduction of ~2700 lines in pnpm-lock.yaml from removed dependencies

Test plan

  • All 28 test suites pass locally with pnpm -r --no-bail test
  • CI passes on all platforms (ubuntu, macos, windows) and Node versions (22, 24, 25)

🤖 Generated with Claude Code

Replace tape, jest, and ts-jest with Node.js built-in test runner
(node:test) and assertion module (node:assert) across all 28 packages.

- tape-based tests → node --test with node:assert
- jest-based tests → node --test with node:assert
- TypeScript tests → node --experimental-strip-types --test
- Removed tape, jest, ts-jest, @types/jest, @types/tape, ts-node devDeps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the monorepo’s test infrastructure by migrating packages off tape/jest/ts-jest/ts-node onto Node.js’s built-in node:test runner and node:assert, updating package test scripts accordingly.

Changes:

  • Rewrote test files to use node:test and node:assert APIs.
  • Updated per-package test scripts to use node --test (and --experimental-strip-types for TS tests).
  • Removed legacy test runner dependencies from package devDependencies.

Reviewed changes

Copilot reviewed 56 out of 57 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
write-json5-file/test.js Migrates tests from tape to node:test + node:assert.
write-json5-file/package.json Updates test script to node --test; removes tape.
write-ini-file/test.js Migrates tests from tape to node:test + node:assert.
write-ini-file/package.json Updates test script to node --test; removes tape.
which-pm/test/index.js Migrates tests from tape to node:test + node:assert.
which-pm/package.json Updates test script to node --test; removes tape.
which-pm-runs/test/index.js Migrates tests from tape to async node:test style (with skip on Windows for bun).
which-pm-runs/package.json Updates test script to node --test; removes tape.
safe-promise-defer/package.json Switches TS tests from Jest to node --experimental-strip-types --test.
safe-promise-defer/tests/index.ts Migrates assertions from Jest expect to node:assert.
run-groups/test/index.ts Migrates tests from tape to node:test + node:assert.
run-groups/package.json Switches TS tests from ts-node to node --experimental-strip-types --test; removes tape/ts-node deps.
root-link-target/test.js Migrates tests from tape to node:test + node:assert.
root-link-target/package.json Updates test script to node --test; removes tape.
rimraf/package.json Switches tests from Jest to node --test; removes Jest config/deps.
rimraf/tests/index.js Migrates assertions from Jest expect to node:assert.
resolve-link-target/test.js Migrates tests from tape to node:test + node:assert.
resolve-link-target/package.json Updates test script to node --test; removes tape.
render-help/package.json Switches TS tests from Jest to node --experimental-strip-types --test; removes Jest deps/config.
render-help/tests/index.ts Migrates assertions from Jest expect to node:assert and adjusts module import.
rename-overwrite/test.js Migrates tests from Jest to node:test + node:assert and replaces Jest mocking.
rename-overwrite/package.json Switches tests from Jest to node --test; removes Jest dependency.
realpath-missing/test.js Migrates tests from tape to node:test + node:assert.
realpath-missing/package.json Updates test script to node --test; removes tape.
read-yaml-file/test.js Migrates tests from tape to node:test + node:assert.
read-yaml-file/package.json Updates test script to node --test; removes tape.
read-json5-file/test/index.js Migrates tests from tape to node:test + node:assert.
read-json5-file/package.json Updates test script to node --test; removes tape.
read-ini-file/test/index.js Migrates tests from tape to node:test + node:assert.
read-ini-file/package.json Updates test script to node --test; removes tape.
promise-share/test.js Migrates tests from tape to node:test + node:assert.
promise-share/package.json Updates test script to node --test; removes tape.
preferred-pm/test/index.js Migrates tests from tape to node:test + node:assert.
preferred-pm/package.json Updates test script to node --test; removes tape.
path-temp/test.js Migrates tests from tape to node:test + node:assert.
path-temp/package.json Updates test script to node --test; removes tape.
p-map-values/package.json Switches TS tests from Jest to node --experimental-strip-types --test; removes Jest deps/config.
p-map-values/tests/index.ts Migrates assertions from Jest expect to node:assert.
make-empty-dir/test.js Migrates tests from tape to node:test + node:assert.
make-empty-dir/package.json Updates test script to node --test; removes tape.
is-subdir/test.js Migrates tests from tape to node:test + node:assert.
is-subdir/package.json Updates test script to node --test; removes tape.
is-inner-link/test.js Migrates tests from tape to node:test + node:assert.
is-inner-link/package.json Updates test script to node --test; removes tape.
graceful-git/test.js Migrates tests from tape to async node:test style.
graceful-git/package.json Updates test script to node --test; removes tape.
dir-is-case-sensitive/test/index.ts Migrates tests from tape to node:test + node:assert.
dir-is-case-sensitive/package.json Switches TS tests from ts-node to node --experimental-strip-types --test; removes tape/ts-node deps.
comver-to-semver/test.js Migrates tests from tape to node:test + node:assert.
comver-to-semver/package.json Updates test script to node --test; removes tape.
can-write-to-dir/test.js Migrates tests from tape to node:test + node:assert.
can-write-to-dir/package.json Updates test script to node --test; removes tape.
can-link/test.js Migrates tests from tape to node:test + node:assert.
can-link/package.json Updates test script to node --test; removes tape.
better-path-resolve/test.js Migrates tests from tape to node:test + node:assert.
better-path-resolve/package.json Updates test script to node --test; removes tape.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Remove unused beforeEach/mock imports in rename-overwrite test
- Add assertion that group 2 tasks executed in run-groups test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zkochan zkochan merged commit 8c2d2b0 into main Mar 11, 2026
18 checks passed
@zkochan zkochan deleted the node-test branch March 11, 2026 01:32
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