From 41f5e855c166b79cc0b0b44ce3606ea5da34dd5e Mon Sep 17 00:00:00 2001 From: vilenarios Date: Tue, 30 Jun 2026 21:38:53 +0000 Subject: [PATCH] ci(test-core): typecheck test files in CI 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) Claude-Session: https://claude.ai/code/session_01XQPK4TXcVoXoyFp6sNW2Lr --- .github/workflows/test-core.yml | 4 ++++ package.json | 1 + 2 files changed, 5 insertions(+) diff --git a/.github/workflows/test-core.yml b/.github/workflows/test-core.yml index 47b59edab..c2cbc4d2e 100644 --- a/.github/workflows/test-core.yml +++ b/.github/workflows/test-core.yml @@ -25,6 +25,10 @@ jobs: - run: yarn --immutable --immutable-cache - run: yarn build - run: yarn lint:check + # Typecheck including test files. `yarn build` uses tsconfig.prod.json, + # which excludes **/*.test.ts, and `yarn test` runs via a type-stripping + # loader — so without this, type errors in test code reach no CI gate. + - run: yarn typecheck - run: yarn test:ci - name: Build core Docker image if: matrix.os == 'ubuntu-latest' diff --git a/package.json b/package.json index f6c51cafb..ce25101a8 100644 --- a/package.json +++ b/package.json @@ -188,6 +188,7 @@ "test:auto-verify:indexing": "node --no-deprecation --import ./register.js src/tests/auto-verify/run.ts", "lint:check": "eslint src test", "lint:fix": "eslint --fix src test", + "typecheck": "tsc --noEmit -p tsconfig.json", "duplicate:check": "jscpd src", "duplicate:report": "jscpd src --reporters html,console", "duplicate:ci": "jscpd src --reporters console --exitCode 1",