Upgrade vitest to 5.0.5 to clear four dev-tooling advisories (#46) #49

Merged
amiryahaya merged 1 commit from chore/46-upgrade-vitest into main 2026-10-22 21:40:44 +02:00
Owner

Upgrades the frontend test tooling off vitest 3.2.7 to clear the four development-tooling advisories the Security workflow found, ahead of their 2026-11-30 exception expiry. Closes #46.

What changed

  • vitest and @vitest/coverage-v8: 3.2.7 to 5.0.5, pinned exactly, together. This removes the vulnerable @vitest/mocker and tinypool dependencies.
  • npm audit now reports 0 vulnerabilities across production and development dependencies. The four exceptions in web/audit-exceptions.txt (GHSA-82fw-gwwq-j7x9, GHSA-qxg6-89mg-rqv8, GHSA-5gmw-xhrv-c9v3, GHSA-85c8-ppgw-ccpr) are removed; the file now has no entries.
  • web/vitest.config.ts: the obsolete coverage.all option is removed (Vitest 5 dropped it).
  • docs/operations/ci.md: version, Node requirement, coverage note and the list of accepted findings updated.
  • All other top-level dependency versions in the lockfile are unchanged (react 19.3.1, vite 6.4.5, jsdom 26.1.0, TypeScript 5.7.3, plugin-react 4.7.0, testing-library packages). The large lockfile diff is vitest's own transitive dependencies.

Compatibility checked

  • Vitest 5.0.5 needs Node ^22.12 || ^24 || >=26; the repository pins 22.23.2 (.node-version, CI image).
  • It needs vite ^6.4 || ^7 || ^8; 6.4.5 is installed and unchanged.
  • I first tried the smaller jump to 4.1.12, but npm's resolver crashed on it with an internal error (Cannot read properties of null (reading 'edgesOut')), so I used 5.0.5, which installs cleanly and is what npm audit recommended.

Verification (local, Node 22.23.2, from a clean npm ci)

  • npm run typecheck, npm test (3 files, 22 tests), npm run test:coverage, npm run build: all pass.
  • npm audit: 0 vulnerabilities. node scripts/audit-npm.mjs: 0 advisories, exit 0. node --test scripts/audit-npm.test.mjs: 9 pass.
  • Coverage still counts untested files: a temporary never-imported file appeared in the report at 0 of 3 lines (then removed), so removing coverage.all did not weaken the gate's denominator.

Please note

  • Reported line coverage changes from about 96.7% to 93.7% with the same tests and the same 80% gate. Vitest 5 counts lines by syntax, so a multi-line JSX return is one line instead of many, which shrinks the denominator. The measured set and the gate are unchanged.
  • The text reporter now hides fully covered files when it detects an agent environment (a Vitest 5 default); the JSON summary always lists every file. CI output may therefore look different from earlier runs.
  • Hosted CI has not run on this change yet: the Web checks job on this PR is the real confirmation that the runner image installs and runs Vitest 5.
  • The Rust side is untouched.

🤖 Generated with Claude Code

Upgrades the frontend test tooling off vitest 3.2.7 to clear the four development-tooling advisories the Security workflow found, ahead of their 2026-11-30 exception expiry. Closes #46. ## What changed - `vitest` and `@vitest/coverage-v8`: 3.2.7 to **5.0.5**, pinned exactly, together. This removes the vulnerable `@vitest/mocker` and `tinypool` dependencies. - `npm audit` now reports **0 vulnerabilities** across production and development dependencies. The four exceptions in `web/audit-exceptions.txt` (GHSA-82fw-gwwq-j7x9, GHSA-qxg6-89mg-rqv8, GHSA-5gmw-xhrv-c9v3, GHSA-85c8-ppgw-ccpr) are removed; the file now has no entries. - `web/vitest.config.ts`: the obsolete `coverage.all` option is removed (Vitest 5 dropped it). - `docs/operations/ci.md`: version, Node requirement, coverage note and the list of accepted findings updated. - All other top-level dependency versions in the lockfile are unchanged (react 19.3.1, vite 6.4.5, jsdom 26.1.0, TypeScript 5.7.3, plugin-react 4.7.0, testing-library packages). The large lockfile diff is vitest's own transitive dependencies. ## Compatibility checked - Vitest 5.0.5 needs Node `^22.12 || ^24 || >=26`; the repository pins 22.23.2 (`.node-version`, CI image). - It needs vite `^6.4 || ^7 || ^8`; 6.4.5 is installed and unchanged. - I first tried the smaller jump to 4.1.12, but npm's resolver crashed on it with an internal error (`Cannot read properties of null (reading 'edgesOut')`), so I used 5.0.5, which installs cleanly and is what `npm audit` recommended. ## Verification (local, Node 22.23.2, from a clean `npm ci`) - `npm run typecheck`, `npm test` (3 files, 22 tests), `npm run test:coverage`, `npm run build`: all pass. - `npm audit`: 0 vulnerabilities. `node scripts/audit-npm.mjs`: 0 advisories, exit 0. `node --test scripts/audit-npm.test.mjs`: 9 pass. - Coverage still counts untested files: a temporary never-imported file appeared in the report at 0 of 3 lines (then removed), so removing `coverage.all` did not weaken the gate's denominator. ## Please note - **Reported line coverage changes from about 96.7% to 93.7%** with the same tests and the same 80% gate. Vitest 5 counts lines by syntax, so a multi-line JSX `return` is one line instead of many, which shrinks the denominator. The measured set and the gate are unchanged. - The text reporter now hides fully covered files when it detects an agent environment (a Vitest 5 default); the JSON summary always lists every file. CI output may therefore look different from earlier runs. - Hosted CI has not run on this change yet: the Web checks job on this PR is the real confirmation that the runner image installs and runs Vitest 5. - The Rust side is untouched. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chore(web): upgrade vitest to 5.0.5 to clear four dev-tooling advisories
All checks were successful
CI / Web checks (pull_request) Successful in 48s
CI / Web checks (push) Successful in 1m20s
CI / Rust checks (pull_request) Successful in 11m31s
CI / Rust checks (push) Successful in 13m26s
0c59d8bef0
Upgrade vitest and @vitest/coverage-v8 together, pinned exactly, from
3.2.7 to 5.0.5. This removes the vulnerable @vitest/mocker and tinypool
dependencies: npm audit now reports no advisories for production or
development dependencies, so the four time-limited exceptions in
web/audit-exceptions.txt are removed.

Vitest 5 needs Node 22.12 or newer (the repository pins 22.23.2) and
vite 6.4 or newer (resolved 6.4.5), and removes coverage.all, so that
option is dropped; the include pattern still counts untested files
(verified with a temporary never-imported file). Vitest 5 counts lines
by syntax, so the same tests report about 93.7% line coverage instead of
about 96.7%; the 80% gate is unchanged. All other top-level dependency
versions are identical.

Closes #46.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No description provided.