You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(build): add coverage thresholds and coverage notes
Add global coverage thresholds to vite.config.ts (80% stmts/lines/funcs,
75% branches) with an explicit exclude list mirroring test.exclude.
Add docs/coverage-notes.md documenting known-low files (useBuzzer.ts ~2%,
db/index.ts ~46%), the rationale for global-only thresholds, and c8 ignore
annotation conventions for untestable callsites.
Files with intentionally low coverage, tracked here until their epics are complete.
4
+
CI enforces **global** thresholds only — no per-file gates.
5
+
6
+
## Known-low files
7
+
8
+
| File | Stmts | Reason | Tracking |
9
+
|---|---|---|---|
10
+
|`hooks/useBuzzer.ts`|~2% | Buzzer epic not yet implemented — WebRTC adjudication logic lives here but has no unit-testable surface until the GM control system is wired up | Buzzer epic |
11
+
|`db/index.ts`|~46% | Low-level Dexie helpers; untested paths are legacy migration scaffolding and emergency purge routines that require real IndexedDB environments | — |
12
+
13
+
## Annotation conventions
14
+
15
+
Use `/* c8 ignore next */` for a single uncovered line:
16
+
```ts
17
+
/* c8 ignore next */
18
+
if (process.env.NODE_ENV==='test') return
19
+
```
20
+
21
+
Use `/* c8 ignore start */` / `/* c8 ignore stop */` for a block:
22
+
```ts
23
+
/* c8 ignore start */
24
+
// WebRTC teardown — untestable without a real peer connection
25
+
peer.destroy()
26
+
/* c8 ignore stop */
27
+
```
28
+
29
+
These annotations suppress v8 coverage for those lines so they do not
30
+
drag down thresholds. Add a comment explaining *why* the block is excluded.
31
+
32
+
## Thresholds (vite.config.ts)
33
+
34
+
| Metric | Threshold |
35
+
|---|---|
36
+
| Statements | 80% |
37
+
| Lines | 80% |
38
+
| Functions | 80% |
39
+
| Branches | 75% |
40
+
41
+
Branches are set slightly lower because JSX ternaries and optional chaining
42
+
generate branch entries that are rarely all exercised in unit tests.
0 commit comments