Skip to content

ci(test-core): typecheck test files in CI#809

Open
vilenarios wants to merge 1 commit into
developfrom
chore/typecheck-tests-ci-gate
Open

ci(test-core): typecheck test files in CI#809
vilenarios wants to merge 1 commit into
developfrom
chore/typecheck-tests-ci-gate

Conversation

@vilenarios

Copy link
Copy Markdown
Contributor

What

Adds a typecheck script (tsc --noEmit -p tsconfig.json) and runs it in test-core.yml between lint:check and test:ci.

Why

Test code currently has no type gate. Two facts combine into a blind spot:

  • yarn build typechecks with tsconfig.prod.json, which excludes **/*.test.ts.
  • yarn test runs through a type-stripping loader (no typecheck).

So a type error in a .test.ts — e.g. a mock object missing a newly-required interface field — passes every PR check and only surfaces if someone runs the test-inclusive tsc by hand. This was hit for real while developing the chunk-fanout work: extending BroadcastChunkResult silently broke 5 typed mocks in rebroadcasting-chunk-source.test.ts, green across all of CI.

Scope

Pure gate addition — the current tree already passes yarn typecheck with 0 errors, so there's no cleanup tail. yarn build still owns emit; this is a fast no-emit check that simply includes tests.

🤖 Generated with Claude Code

Test code had no type gate. `yarn build` typechecks with tsconfig.prod.json,
which excludes **/*.test.ts; `yarn test` runs through a type-stripping loader.
So a type error in a .test.ts (e.g. a mock missing a newly-required interface
field) passed every PR check and only surfaced if someone ran the
test-inclusive `tsc` by hand.

Add a `typecheck` script (`tsc --noEmit -p tsconfig.json`, which includes
tests) and run it in test-core.yml between lint and test. The current tree
already passes it (0 errors), so this is a pure gate addition with no cleanup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XQPK4TXcVoXoyFp6sNW2Lr
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 81a094bd-9d10-4983-8bef-a456d8f56283

📥 Commits

Reviewing files that changed from the base of the PR and between feefd25 and 41f5e85.

📒 Files selected for processing (2)
  • .github/workflows/test-core.yml
  • package.json

📝 Walkthrough

Walkthrough

This PR adds a typecheck script to package.json that runs tsc --noEmit -p tsconfig.json, and adds a new CI step in the test-core workflow that invokes it after yarn lint:check, with comments explaining why type errors in test files aren't otherwise caught.

Changes

CI Typecheck Addition

Layer / File(s) Summary
Add typecheck script and wire into CI
package.json, .github/workflows/test-core.yml
Adds a typecheck npm script using tsc --noEmit -p tsconfig.json and a new CI step that runs it after lint check, with comments explaining that build excludes test files and test:ci uses a type-stripping loader.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: adding typechecking for test files in CI.
Description check ✅ Passed The description directly matches the implemented CI typecheck script and workflow change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/typecheck-tests-ci-gate

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.77%. Comparing base (96ede32) to head (41f5e85).
⚠️ Report is 19 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #809      +/-   ##
===========================================
+ Coverage    78.65%   78.77%   +0.12%     
===========================================
  Files          132      132              
  Lines        49980    50093     +113     
  Branches      3763     3781      +18     
===========================================
+ Hits         39312    39461     +149     
+ Misses       10620    10584      -36     
  Partials        48       48              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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