New phase from the 5-item analysis: linked showcase snippets + animations, runnable scaffolding generators (pages/wizards/context/SSP), dependency graph + declarative boundaries, PII hardening (branded Bsn VO + masked-value atom + persisted no-PII audit) doubling as a privacy showcase, and Vitest coverage. Goal: both a teaching showcase and a production starter template. Sequenced with priorities + dependencies in the README. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
35 lines
1.5 KiB
Markdown
35 lines
1.5 KiB
Markdown
# 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.
|