Skip to content

test-infra: gate clients/web/src/lib/** under the vitest coverage include globs #1594

Description

@cliffhall

Background

Surfaced during the Wave-1 smoke/audit pass (PRs #1586, #1588, #1592). The web coverage gate does not measure clients/web/src/lib/**.

clients/web/vite.config.ts sets coverage.include to:

src/components/**, src/utils/**, clients/web/server/**, core/**

src/lib/** is not in that list. So the per-file ≥90 gate (npm run test:coverage) silently does not apply to library modules under src/lib, including:

Net: new src/lib code can regress below the four-dimension floor without CI noticing.

Scope

  1. Add src/lib/** (or clients/web/src/lib/** matching the existing entries' form) to the coverage.include array in clients/web/vite.config.ts.
  2. Fold the file-specific sandbox-csp.{ts,tsx} entry added in feat(web): add sandbox CSP builder library (closes #1558) #1588 back into the glob (remove the now-redundant single-file include).
  3. Bring every existing src/lib file up to ≥90 on all four dimensions once gated — add tests where thin, and annotate genuinely-unreachable branches with a justified /* v8 ignore … -- <reason> */ (e.g. downloadFile.ts's String.split(...).pop() ?? "" defensive fallback).
  4. Confirm npm run test:coverage (web) stays green with the broadened include.

Acceptance

  • src/lib/** is covered by the coverage include; the redundant single-file sandbox-csp entry is gone.
  • All current src/lib files clear ≥90 on lines/statements/functions/branches, or carry a justified v8 ignore for provably-dead branches.
  • CI's web test:coverage passes with the broadened gate.

Refs: #1560, #1586, #1558, #1588, #1548, #1592, tracking #1579.

Metadata

Metadata

Assignees

Labels

v2Issues and PRs for v2

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions