diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a53a08d2..7dea55e1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -154,6 +154,12 @@ jobs: - name: Install working-directory: infrastructure run: npm ci --prefer-offline + - name: Type-check (tsc --noEmit) + working-directory: infrastructure + # Single shared type-check for the whole project. jest now transpiles + # only (isolatedModules), so this is where infra type errors are caught + # on a PR — cheaper once here than re-run inside every jest worker. + run: npm run build - name: Run tests working-directory: infrastructure run: npx jest --maxWorkers=2 diff --git a/infrastructure/jest.config.js b/infrastructure/jest.config.js index e9a42040..15b3c4cb 100644 --- a/infrastructure/jest.config.js +++ b/infrastructure/jest.config.js @@ -4,6 +4,12 @@ module.exports = { testMatch: ['**/*.test.ts'], transform: { '^.+\\.tsx?$': ['ts-jest', { + // Transpile-only: skip per-worker type-checking (each jest worker + // otherwise re-type-checks the whole project with no shared cache, the + // dominant cost of this suite). Type safety is enforced once by the + // `tsc --noEmit` step in the CI job (.github/workflows/tests.yml) and by + // `npm run build` locally. Safe here: no `const enum` in the tree. + isolatedModules: true, diagnostics: { ignoreCodes: [151002], },