Repository navigation
test: typecheck the tests with the source - #117
Merged
Merged
Conversation
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>
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 typecheckskips everysrc/**/*.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 andtscemits 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 ofsrc/. The vendoredtools/oxlint/anti-slopis 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.isDefinednarrows the optional defaults block before it goes tosettingsFor.tsconfig.jsonconsequences say the suite is type-checked.Test plan
pnpm typecheckwith only the exclusion removed: fails with exactly the two errors in test: typecheck the tests with the source #116 (TS2345 inconfig.test.ts:118, TS2379 ininit.test.ts:258)pnpm check: pass, 816 testsfixdropped from the fixture it still fails ondefaults.fix.commitssrc/scratch.test.tswithconst n: number = "one"failspnpm typecheck(TS2322), then deletedRisk
None at run time: nothing shipped changes. At worst the typecheck rejects a test it used to skip, and reverting the one
excludeline brings the old behaviour back.Closes #116
🤖 Generated with Claude Code