diff --git a/docs/contributing.md b/docs/contributing.md index 297cabd..348958f 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -45,7 +45,7 @@ stay in step with `action.yml` and the label catalogue. | Command | What it runs | |---------|--------------| | `npm test` | The whole Vitest suite | -| `npm run test:coverage` | The suite with v8 coverage; CI enforces the thresholds in `vitest.config.mjs` (lines 85, branches 83, functions 91, statements 85) | +| `npm run test:coverage` | The suite with v8 coverage; CI enforces the thresholds in `vitest.config.mjs` (lines 99, branches 99, functions 99, statements 99, a floor set just under what `main` reaches) | | `npx vitest run __tests__/bundle` | Only the bundle acceptance harness | | `npm run test:coverage:e2e` | Only the bundle acceptance harness, run against a source-mapped bundle built from `__tests__/bundle/coverageEntry/` into `.coverage-bundle/` so its hits are reported against `src/`, written to `coverage-e2e/` so it never overwrites the unit run's `coverage/` (ncc's map is line-only, so the build also emits tsc's per-file maps into `.coverage-bundle/tsc/` and `coverageEntry/remap.mjs` composes their columns into it; without that, inner lines of a multi-line expression that tsc flattens onto one JS line report 0 hits). This is end-to-end-only coverage and is deliberately reported separately from `test:coverage`: the unit run already reaches every line, so a union would say nothing about what the bundle exercises, and the two runs' statement and branch maps come from different transforms (vite vs. tsc+webpack) and do not combine. Fails below 99 % lines / 95 % branches / 98 % functions / 99 % statements (`vitest.e2e-coverage.config.mjs`), a floor set just under what `main` reaches so a scenario that stops driving a `src/` path is caught | diff --git a/vitest.config.mjs b/vitest.config.mjs index e0c3469..ea259fb 100644 --- a/vitest.config.mjs +++ b/vitest.config.mjs @@ -17,11 +17,13 @@ export default defineConfig({ include: ['src/**/*.ts'], // lcovonly + json-summary are machine-readable for CI artifacts and job summaries reporter: ['text', 'text-summary', 'lcovonly', 'json-summary'], + // Regression floor set just under what main reaches (100 / 99.7 / 100 / 100 + // at 1062ce7) so a drop of about one point fails build-test. thresholds: { - lines: 95, - branches: 93, - functions: 98, - statements: 95, + lines: 99, + branches: 99, + functions: 99, + statements: 99, }, }, },