# WP-46 — Vitest coverage (report + thresholds) Status: todo Phase: 8 — platform/DX/showcase Priority: P1 ## Why Tests run via the `@angular/build:unit-test` (Vitest) builder but report no coverage — there's no visibility into what the house test rules actually cover. A template/showcase should surface this. ## Decisions - **Step 1 — verify wiring:** confirm how coverage is enabled with the Angular unit-test builder (`codeCoverage` option and/or a vitest config), add `@vitest/coverage-v8`. - `npm run test:coverage` → text + HTML/lcov report. - **Report-only first** (ponytail: visibility before a blocking gate, like the semgrep job). Threshold focus on the layers the house rules already demand tests for (`domain/**`, pure combinators, `parse*` boundaries, reducers), not a blanket global %; exclude stories, the generated `api-client.ts`, and DTOs/contracts. - Wire into `ci-local.sh`/CI **non-blocking**, with a documented path to flip on enforcement later. - **Open choice:** report-only vs enforce a minimum now. ## Files - `package.json` (`test:coverage` + dep), coverage config (builder option or vitest config). - `scripts/ci-local.sh` / `.github/workflows/ci.yml` — non-blocking coverage step. - `.gitignore` — ignore the coverage output dir. ## Acceptance criteria - [ ] `npm run test:coverage` produces a report (text + HTML/lcov) with sensible excludes. - [ ] Coverage runs in CI without failing the build (report-only). - [ ] `npm run ci` green.