test(web): gate src/lib/** under the coverage include globs (closes #1594)

Broaden the web vitest `coverage.include` from the single-file
`src/lib/sandbox-csp.{ts,tsx}` entry to `src/lib/**/*.{ts,tsx}` so the
per-file >=90 four-dimension gate applies to every library module under
`src/lib`, not just sandbox-csp.

- Add unit tests for the previously-ungated `environmentFactory.ts`
  (createWebEnvironment) and `types/customHeaders.ts` value helpers,
  bringing both to 100% on all four dimensions.
- Annotate downloadFile.ts's provably-dead `?? ""` fallback (String.split
  always returns a non-empty array so .pop() is never undefined) with a
  justified `v8 ignore`, closing its last uncovered branch (92.3 -> 100).

All five src/lib files now report 100/100/100/100.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S3fTN8H3R8YV4yUGvZjYnX
This commit is contained in:
cliffhall 2026-07-01 22:23:43 -04:00
commit 1fd1313c96

View file

@ -101,10 +101,7 @@ export default defineConfig(({ command }) => {
include: [
'src/components/**/*.{ts,tsx}',
'src/utils/**/*.{ts,tsx}',
// Pure, fully-tested sandbox CSP builder library. Listed by file (not a
// `src/lib/**` glob) so the untested legacy siblings in src/lib are not
// pulled under the gate before they have tests of their own.
'src/lib/sandbox-csp.{ts,tsx}',
'src/lib/**/*.{ts,tsx}',
'clients/web/server/**/*.{ts,tsx}',
path.join(repoRoot, 'core/mcp/**/*.{ts,tsx}'),
path.join(repoRoot, 'core/react/**/*.{ts,tsx}'),