Replace tap with the built-in node:test runner#58
Merged
Conversation
IlyasShabi
previously approved these changes
Jun 9, 2026
This comment has been minimized.
This comment has been minimized.
tap (via @tapjs/processinfo) pulled in uuid@14, whose node build
references the global `crypto`; that is unavailable unflagged on Node 18
and unreliable in processinfo's loader hook, which broke CI. Drop the tap
dependency entirely in favor of Node's built-in test runner.
- Rewrite src/index.test.ts against node:test + node:assert. tap's loose
assertions are mapped as: equal -> strictEqual, same -> deepEqual
(loose), and has -> a small recursive loose-subset helper (assertHas).
- Compile the tests with tsc (tsconfig.test.json) to dist-test/ and run
them with `node --test`, so they work on every supported Node version
including 18 (which cannot strip types natively).
- Fix testing/proto/package.json to {"type":"commonjs"} so the generated
CJS protobuf module resolves under Node's native ESM loader.
- Re-add Node 18 and add Node 26 to the test matrix.
Verified 72/72 passing on Node 18, 20, 22, 24, and 26.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9e4977b to
0de153e
Compare
IlyasShabi
approved these changes
Jun 9, 2026
szegedi
added a commit
that referenced
this pull request
Jun 10, 2026
szegedi
added a commit
that referenced
this pull request
Jun 10, 2026
tap (via @tapjs/processinfo) pulled in uuid@14, whose node build
references the global `crypto`; that is unavailable unflagged on Node 18
and unreliable in processinfo's loader hook, which broke CI. Drop the tap
dependency entirely in favor of Node's built-in test runner.
- Rewrite src/index.test.ts against node:test + node:assert. tap's loose
assertions are mapped as: equal -> strictEqual, same -> deepEqual
(loose), and has -> a small recursive loose-subset helper (assertHas).
- Compile the tests with tsc (tsconfig.test.json) to dist-test/ and run
them with `node --test`, so they work on every supported Node version
including 18 (which cannot strip types natively).
- Fix testing/proto/package.json to {"type":"commonjs"} so the generated
CJS protobuf module resolves under Node's native ESM loader.
- Re-add Node 18 and add Node 26 to the test matrix.
Verified 72/72 passing on Node 18, 20, 22, 24, and 26.
szegedi
added a commit
that referenced
this pull request
Jun 10, 2026
Merged
szegedi
added a commit
that referenced
this pull request
Jun 16, 2026
tap (via @tapjs/processinfo) pulled in uuid@14, whose node build
references the global `crypto`; that is unavailable unflagged on Node 18
and unreliable in processinfo's loader hook, which broke CI. Drop the tap
dependency entirely in favor of Node's built-in test runner.
- Rewrite src/index.test.ts against node:test + node:assert. tap's loose
assertions are mapped as: equal -> strictEqual, same -> deepEqual
(loose), and has -> a small recursive loose-subset helper (assertHas).
- Compile the tests with tsc (tsconfig.test.json) to dist-test/ and run
them with `node --test`, so they work on every supported Node version
including 18 (which cannot strip types natively).
- Fix testing/proto/package.json to {"type":"commonjs"} so the generated
CJS protobuf module resolves under Node's native ESM loader.
- Re-add Node 18 and add Node 26 to the test matrix.
Verified 72/72 passing on Node 18, 20, 22, 24, and 26.
szegedi
added a commit
that referenced
this pull request
Jun 16, 2026
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.
Why
The recent
tapbump (#49) surfaced thattap— via@tapjs/processinfo— pulls inuuid@14, whose node build references the globalcrypto. That global is unavailable unflagged on Node 18 and is unreliable inside processinfo's ESM loader hook, which broke CI. Rather than work around a heavyweight test-runner dependency, this dropstapentirely in favor of Node's built-in test runner.What
Rewrite
src/index.test.tsagainstnode:test+node:assert. tap's loose assertions map directly:t.equal→assert.strictEqualt.same→assert.deepEqual(loose — needed for the protobufjs-compat test, which compares bigint/number against the string longs thattoObject({longs: String})produces)t.has→ a small recursive loose-subset helper (assertHas)The
constructs/encodes/decodestap plugin became plain functions taking the test context.Compile tests with
tsc(tsconfig.test.json) todist-test/and run them withnode --test, so they work on every supported Node version — including 18, which can't strip types natively.Fix
testing/proto/package.json{"module":"commonjs"}→{"type":"commonjs"}so the generated CJS protobuf module resolves under Node's native ESM loader. (The old value was a no-op that only worked because tap's loader bypassed native resolution.)Drop the
tapdependency and its config block.Re-add Node 18 and add Node 26 to the test matrix (now
[18, 20, 22, 24, 26]).Verification
npm testandnpm run lintpass locally. The compiled tests were run on Node 18, 20, 22, 24, and 26 — 72/72 passing on every version. A negative check (corrupting one expected encoding) fails correctly with exit 1.🤖 Generated with Claude Code