diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index a3387bf..2b78dd7 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -160,8 +160,10 @@ jobs: run: npm ci working-directory: frontend + # tsconfig.test.json, not the default: the default leaves the unit tests out + # so the Docker build (which has only frontend/) can type-check the app. - name: Type check - run: npx vue-tsc --noEmit + run: npx vue-tsc --noEmit -p tsconfig.test.json working-directory: frontend - name: Unit tests diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index e323b46..1400e6e 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -15,5 +15,6 @@ "noImplicitReturns": true, "types": [] }, - "include": ["src"] + "include": ["src"], + "exclude": ["src/**/*.test.ts"] } diff --git a/frontend/tsconfig.test.json b/frontend/tsconfig.test.json new file mode 100644 index 0000000..9cb4d28 --- /dev/null +++ b/frontend/tsconfig.test.json @@ -0,0 +1,9 @@ +{ + // The app's config plus its unit tests. tsconfig.json leaves the tests out because + // the production build type-checks in a Docker stage that copies only frontend/, + // and grammar.test.ts reads ../core/testdata, which is not there (run 8478). + // CI's typecheck lane runs THIS file, so the tests are still type-checked. + "extends": "./tsconfig.json", + "include": ["src"], + "exclude": [] +}