8000 test: typecheck the tests with the source by dominikwozniak · Pull Request #117 · dominikwozniak/dw-mc · GitHub
[go: up one dir, main page]

Skip to content

test: typecheck the tests with the source - #117

Merged
dominikwozniak merged 2 commits into
mainfrom
test/116-typecheck-tests
Sep 19, 2026
Merged

dominikwozniak merged 2 commits into
mainfrom
test/116-typecheck-tests

Conversation

@dominikwozniak
Copy link
Copy Markdown
Owner

pnpm typecheck skips every src/**/*.test.ts, so a test can hold a type error and the gate stays green. The exclusion guards nothing: tsdown bundles from the entry point and tsc emits nothing, so no package is left to keep the tests out of. One configuration now checks the tests with the modules they sit beside.

What changes

  • tsconfig.json: checks all of src/. The vendored tools/oxlint/anti-slop is the only exclusion left.
  • src/adapters/config.test.ts: walks the schema's own AST (SchemaAST.isObjects) in place of a hand-written shape that an array field does not match.
  • src/cli/init.test.ts: assert.isDefined narrows the optional defaults block before it goes to settingsFor.
  • ADR 0005, ADR 0006: the tsconfig.json consequences say the suite is type-checked.

Test plan

  • pnpm typecheck with only the exclusion removed: fails with exactly the two errors in test: typecheck the tests with the source #116 (TS2345 in config.test.ts:118, TS2379 in init.test.ts:258)
  • pnpm check: pass, 816 tests
  • the schema walk returns the same 14 keys as the walk it replaces; with fix dropped from the fixture it still fails on defaults.fix.commits
  • a scratch src/scratch.test.ts with const n: number = "one" fails pnpm typecheck (TS2322), then deleted

Risk

None at run time: nothing shipped changes. At worst the typecheck rejects a test it used to skip, and reverting the one exclude line brings the old behaviour back.

Closes #116

🤖 Generated with Claude Code

dominikwozniak and others added 2 commits September 19, 2026 19:34
Both tests pass at run time and fail tsc once it reads them. The config
test walked the schema through a hand-written shape that an array field
does not match; it now walks the schema's own AST, which names the same
fourteen keys and still fails on a fixture missing one. The init test
handed an optional defaults block on as if it were set; it now asserts
that it is, which narrows it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
tsconfig.json still excluded the tests after the build moved to tsdown
and the second configuration that checked them was deleted, so no link
in the gate type-checked a test. Nothing is emitted any more, so there
is no package for the exclusion to keep them out of: one configuration
checks all of src, and both records say so.

Closes #116

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@dominikwozniak
dominikwozniak merged commit d6fde14 into main Sep 19, 2026
1 check passed
@dominikwozniak
dominikwozniak deleted the test/116-typecheck-tests branch September 19, 2026 17:40
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.

test: typecheck the tests with the source

1 participant

0