Skip to content

Type-check test files with Jest types - #168

Merged
jtklein-agents merged 1 commit into
masterfrom
jest-types
Nov 15, 2026
Merged

jtklein-agents merged 1 commit into
masterfrom
jest-types

Conversation

@jtklein-agents

Copy link
Copy Markdown
Owner

Summary

Test files now see Jest globals in the typecheck, so the @ts-nocheck header comes off wherever a test is otherwise type-clean.

 package.json
+  "@types/jest": "27.5.2"        # matches jest 27.5.1
 scripts/typecheck-baseline.txt
-  src/app/App.test.js … Cannot find name 'it'
-  src/app/App.test.js … Cannot find name 'expect'
 src/**/*.test.js
-// @ts-nocheck — Jest globals. checkJs has no test runner types.     (15 files: removed)
+// @ts-nocheck — test doubles and window.rendererBridge are untyped. (27 files: reworded)

The old header blamed Jest globals; with them typed, the remaining 27 files still hide 77 real errors (mostly window.rendererBridge, which production code reaches through casts, plus untyped doubles). Fixing those is follow-up work, not this PR.

Evidence

  • Before: typecheck:baseline carried App.test.js: Cannot find name 'it'; 43 test files skipped type checking.
    After: typecheck:baseline passes with those lines gone; 16 test files are type-checked. Lint and jest (111 tests) pass.

Merge Danger

Door: two-way

Blast Radius: CI typecheck

A new test that is not type-clean now fails typecheck:baseline unless it carries the header. Dev dependency only; nothing ships.

🤖 Generated with Claude Code

Install @types/jest so test files see Jest globals. Fifteen test files now type-check
without a header; the remaining ones keep @ts-nocheck, reworded to the real reason:
untyped test doubles and window.rendererBridge. Drops the two App.test.js baseline lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jtklein-agents
jtklein-agents merged commit 8ee8df6 into master Nov 15, 2026
11 checks passed
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