diff --git a/docs/contributing.md b/docs/contributing.md index 297cabd..5f3b97c 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -47,7 +47,7 @@ stay in step with `action.yml` and the label catalogue. | `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) | | `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 | +| `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 / 97 % branches / 99 % 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 | Unit tests under `__tests__/` import `src/` directly and mock the GitHub API with [msw](https://mswjs.io/). The acceptance harness in `__tests__/bundle/` diff --git a/vitest.e2e-coverage.config.mjs b/vitest.e2e-coverage.config.mjs index bca64ff..c561732 100644 --- a/vitest.e2e-coverage.config.mjs +++ b/vitest.e2e-coverage.config.mjs @@ -45,12 +45,13 @@ export default mergeConfig(base, defineConfig({ autoAttachSubprocess: true, excludeAfterRemap: true, // Regression floor for the bundle-only run, set just under what main reaches - // (99.54 / 96.25 / 98.79 / 99.56 at d93ecb8) so a scenario that stops - // exercising a src/ path fails this run instead of silently lowering the figure. + // (99.95 / 97.96 / 100 / 99.96 at 1062ce7; 99.54 / 96.25 / 98.79 / 99.56 when + // first set at d93ecb8) so a scenario that stops exercising a src/ path fails + // this run instead of silently lowering the figure. thresholds: { lines: 99, - branches: 95, - functions: 98, + branches: 97, + functions: 99, statements: 99, }, },