Skip to content

Type-check the tests of every package, and fix what the checker found - #696

Merged
felipesauer merged 12 commits into
main-v1from
the-tests-are-type-checked
Oct 4, 2026
Merged

felipesauer merged 12 commits into
main-v1from
the-tests-are-type-checked

Conversation

@felipesauer

Copy link
Copy Markdown
Owner

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.

…ds the product requires and narrow readings instead of reading through the union
…ts with the fields the catalog defines, and read tail ids through the public getter
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 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
felipesauer merged commit 016f7f7 into main-v1 Oct 4, 2026
6 checks passed
@felipesauer
felipesauer deleted the the-tests-are-type-checked branch October 4, 2026 14:42
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.
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.

1 participant