fix: make the tsd type tests actually run - #322
Merged
Conversation
cryptodev-2s
force-pushed
the
migrate/pr2h-fix-tsd
branch
from
September 7, 2026 12:31
0458748 to
bfafe6e
Compare
cryptodev-2s
force-pushed
the
migrate/pr2h-fix-tsd
branch
from
September 7, 2026 12:31
0458748 to
bfafe6e
Compare
cryptodev-2s
removed this pull request from stack #329
September 9, 2026 11:46
cryptodev-2s
added this pull request to stack #331
September 9, 2026 11:47
cryptodev-2s
force-pushed
the
migrate/pr2h-fix-tsd
branch
from
September 9, 2026 16:09
bfafe6e to
e8dc5d6
Compare
cryptodev-2s
force-pushed
the
migrate/pr2h-fix-tsd
branch
2 times, most recently
from
September 9, 2026 16:32
1342ebd to
ebe3626
Compare
cryptodev-2s
force-pushed
the
migrate/pr2h-fix-tsd
branch
from
September 9, 2026 18:31
ebe3626 to
bd9da37
Compare
cryptodev-2s
force-pushed
the
migrate/pr2h-fix-tsd
branch
from
September 9, 2026 18:47
bd9da37 to
940bd3d
Compare
Mrtenz
previously approved these changes
Sep 10, 2026
cryptodev-2s
dismissed
Mrtenz’s stale review
September 10, 2026 10:15
The merge-base changed after approval.
cryptodev-2s
force-pushed
the
migrate/pr2h-fix-tsd
branch
from
September 10, 2026 10:15
940bd3d to
3a62695
Compare
cryptodev-2s
force-pushed
the
migrate/pr2h-fix-tsd
branch
from
September 10, 2026 10:28
3a62695 to
a9b87c7
Compare
cryptodev-2s
removed this pull request from stack #331
September 10, 2026 10:40
cryptodev-2s
force-pushed
the
migrate/pr2h-fix-tsd
branch
from
September 10, 2026 10:41
a9b87c7 to
e0aa73c
Compare
cryptodev-2s
added this pull request to stack #335
September 10, 2026 10:41
Mrtenz
approved these changes
Sep 10, 2026
cryptodev-2s
force-pushed
the
migrate/pr2h-fix-tsd
branch
from
September 10, 2026 12:46
e0aa73c to
edaf2fa
Compare
cryptodev-2s
force-pushed
the
migrate/pr2h-fix-tsd
branch
from
September 10, 2026 13:03
edaf2fa to
d1267ad
Compare
cryptodev-2s
force-pushed
the
migrate/pr2h-fix-tsd
branch
from
September 10, 2026 13:08
d1267ad to
bc2e3f5
Compare
`yarn test:types` runs bare `tsd`, which finds no test files at all. It produces no output and exits 0 no matter what, so the 460 lines of type assertions in src/*.test-d.ts have not been checking anything. Proof: appending `expectAssignable<Hex>(999)` to hex.test-d.ts still exits 0. Pointing tsd at the files explicitly reports it correctly and exits 1. The cause is the `types` field. tsd resolves test files relative to it, and it has pointed at ./dist/index.d.cts since ts-bridge was adopted in #182 on 2024-04-23, which tsd 0.29 does not resolve. The `tsd.directory` setting does not compensate. There have been 26 releases since, all with this check silently passing. Fixing the invocation rather than the `types` field, since the latter is correct for consumers and only tsd is confused by it. All four existing files pass once actually executed, so nothing needed changing in them.
cryptodev-2s
force-pushed
the
migrate/pr2h-fix-tsd
branch
from
September 10, 2026 13:15
bc2e3f5 to
b934063
Compare
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.
Top of stack #315, on #321.
yarn test:typesruns baretsd, which finds no test files at all. It produces no output and exits 0 regardless, so the 460 lines of type assertions acrosssrc/*.test-d.tshave not been checking anything.Proof, before this change:
Pointing tsd at the files explicitly reports it properly and exits 1:
Cause
tsd resolves test files relative to the
typesfield, which has pointed at./dist/index.d.ctssince ts-bridge was adopted in #182 (2024-04-23). tsd 0.29 does not resolve.d.cts, and thetsd.directorysetting does not compensate. 26 releases have shipped since, all with this check silently passing.Fix
Fixing the invocation rather than the
typesfield, since the field is correct for consumers and only tsd is confused by it.All four files pass once actually executed, so none of them needed changing.
yarn test:typesnow exits 1 on a bad assertion and 0 when clean.Relevance to the migration
This was found while working out what to do with tsd in Phase B, since core has no way to run it. Worth knowing the honest baseline before deciding: these assertions have been dormant for 17 months, so whatever we do with them in core, we are not losing coverage we currently have.
Note
Low Risk
Only the npm script for type testing changed; runtime package behavior and public types are unchanged.
Overview
yarn test:typeswas a no-op: baretsdnever picked up thesrc/*.test-d.tssuites (because of how it resolves files vs the packagetypesentry), so type assertions could fail silently while CI still exited 0.The script now runs
tsd --files 'src/*.test-d.ts', so those assertions actually execute andyarn test:typesfails when a type check is wrong. No changes to the test files themselves were required once they were being run.Reviewed by Cursor Bugbot for commit b934063. Bugbot is set up for automated code reviews on this repo. Configure here.