Type-check the tests of every package, and fix what the checker found - #696
Merged
Merged
Conversation
…eeps every test file in reach
…ds the product requires and narrow readings instead of reading through the union
… of reading fields that are not there
…ts with the fields the catalog defines, and read tail ids through the public getter
…he sort hands over, and pin it in a test
Read the CI scripts' own JSDoc types in the test tsconfig, give the tests a lastIndexWhere in place of the ES2023 findLastIndex, and drop the helpers and constants nothing read.
Pass the working directory every MCP server is built with, build the discovery environment from its real field, narrow the result unions the tests read, and replace the removed ChainEvent with CatalogEvent.
… the branch count that moves between passes
…ion' into the-tests-are-type-checked
…-tests-are-type-checked
The typecheck script runs the test configs after the build, so the ruler guard pins the new script, and the clause census lists the new test and support files and the counts the shared helper moved.
felipesauer
added a commit
that referenced
this pull request
Oct 5, 2026
…#696) `pnpm typecheck` now runs `tsc -b` and then each package's test config (`tsc -p tsconfig.test.json`), and CI runs `pnpm typecheck`. A guard pins the script and a test checks that every test file is covered by a config. Errors found in the tests, 326 to 0: chain 38, core 61, context 8, action 1, code 218. What the checker found: - Two vacuous tests, now fixed: `the-verdict-in-the-browser.test.ts` read a `witness.state` that does not exist, and `context/sources.test.ts` passed a field that was ignored. - Four tests whose HOME sandbox isolated nothing (the `home` field was undefined). - The order of `byCountThenWhich` is now covered, and the comparator has no branch per side. The clause census and the ruler guard were updated to the new script and the new files.
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.
pnpm typechecknow runstsc -band then each package's test config (tsc -p tsconfig.test.json), and CI runspnpm typecheck. A guard pins the script and a test checks that every test file is covered by a config.Errors found in the tests, 326 to 0: chain 38, core 61, context 8, action 1, code 218.
What the checker found:
the-verdict-in-the-browser.test.tsread awitness.statethat does not exist, andcontext/sources.test.tspassed a field that was ignored.homefield was undefined).byCountThenWhichis now covered, and the comparator has no branch per side.The clause census and the ruler guard were updated to the new script and the new files.