Skip to content

fix: typecheck the contract test file (#6) - #7

Merged
williamzujkowski merged 1 commit into
mainfrom
fix/qa-cleanup
Jun 16, 2026
Merged

fix: typecheck the contract test file (#6)#7
williamzujkowski merged 1 commit into
mainfrom
fix/qa-cleanup

Conversation

@williamzujkowski

Copy link
Copy Markdown
Collaborator

Summary

tsconfig.json excluded **/*.test.ts, so tsc --noEmit only ever checked schemas.ts — never schemas.test.ts, which is the repo's entire deliverable (the upstream-schema-drift contract test). A type error in the test (bad import after a schema rename, mismatched safeParse arg, etc.) passed the typecheck gate clean.

Change

  • Add tsconfig.test.json extending the base with noEmit + declaration: false, re-including test files.
  • typecheck script now runs tsc --noEmit && tsc -p tsconfig.test.json.
  • build still uses tsconfig.json, so dist/ emits only schemas.js/schemas.d.ts — no test declarations leak into the build.

Verification

  • Red: injecting const x: number = "..." into schemas.test.ts now fails npm run typecheck (error TS2322).
  • Green: full sequence (typecheck / test 15 passed / build) passes; dist/ unchanged.

Fixes #6

🤖 Generated with Claude Code

tsconfig.json excludes **/*.test.ts so `tsc --noEmit` only checked
schemas.ts, never schemas.test.ts — the repo's entire deliverable. A
type-level drift in how the test consumes the schemas (the exact failure
this repo exists to surface) passed the typecheck gate clean.

Add tsconfig.test.json (extends base, noEmit, declaration off,
re-includes test files) and run it as a second step in the `typecheck`
script. `build` still uses tsconfig.json, so dist/ contains only
schemas.js/.d.ts — no test declarations emitted.

Verified: a deliberate type error in schemas.test.ts now fails
`npm run typecheck`, and the full sequence (typecheck/test/build) is green.

Fixes #6

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@williamzujkowski
williamzujkowski merged commit 57d31fd into main Jun 16, 2026
5 checks passed
@williamzujkowski
williamzujkowski deleted the fix/qa-cleanup branch June 16, 2026 03:43
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.

[QA] typecheck script never checks the test file (tsconfig excludes **/*.test.ts)

1 participant