chore(deps): update dependency vitest to v4 [security] - #3789
Conversation
4f7e7d8 to
2c41b15
Compare
2c41b15 to
a30005c
Compare
a30005c to
2922509
Compare
2922509 to
248addf
Compare
248addf to
a32462f
Compare
a32462f to
e95f9cc
Compare
e95f9cc to
b66c567
Compare
b66c567 to
328a303
Compare
328a303 to
0849deb
Compare
0849deb to
bec44ca
Compare
bec44ca to
3e29312
Compare
3e29312 to
4aada05
Compare
4aada05 to
6fa8f22
Compare
6fa8f22 to
2569645
Compare
2569645 to
b5f5c5e
Compare
b5f5c5e to
1461c32
Compare
1461c32 to
637d877
Compare
637d877 to
297718c
Compare
297718c to
d84f43c
Compare
d84f43c to
19b1b81
Compare
19b1b81 to
66f652b
Compare
66f652b to
e9ee0b9
Compare
e9ee0b9 to
b5f3763
Compare
b5f3763 to
e282599
Compare
e282599 to
adc23f7
Compare
Edited/Blocked NotificationRenovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. |
miga-heygen
left a comment
There was a problem hiding this comment.
Reviewed at head e4fe6d7968280a43365e4b720f0cdf4739a5436c (two commits on top of main at c98d6fba: the Renovate bump and the compatibility fix). Did a real bun install --frozen-lockfile in an isolated worktree and ran every changed suite under the installed Vitest 4.1.11, then mutation-checked each shim.
Strengths
packages/studio/src/test-setup.ts:8— theconfirmfallback is the right place and the right default: production callswindow.confirm(...)directly in five components, only two suites reach those paths, and both stub it viavi.spyOn; a() => falsedefault means an unstubbed path declines rather than proceeding.packages/cli/src/registry/remote.test.ts:59—.mockClear()on the re-spiedfetchreproduces the Vitest 3 semantics exactly (a fresh spy with empty history), sotoHaveBeenCalledTimes(1)still means "the second call made exactly one network attempt". No assertion weakened.
Verified
- Scope:
git diff --statvs merge-base is 27 files, all of thembun.lock, 13package.jsonmanifests,*.test.ts(x),test-setup.tsandpackages/studio/tsconfig.json. No production source changed.tsconfig.jsonisnoEmit;tsup.config.tsbuilds fromtsconfig.lib.json, which excludes tests andtest-setup.ts, so nothing here reaches build output. - Lockfile:
vitest,@vitest/{expect,mocker,runner,snapshot,spy,utils,pretty-format,coverage-v8}all resolve to exactly4.1.11.vitestays6.4.2; no@vitejs/*,rollup,esbuild,reactorreact-domentries move. Transitive deltas are confined to Vitest's own tree:chai5→6,std-env3→4,tinyrainbow2→3,magicast0.3→0.5 (with nested@babel/parser/types7.29.8),ast-v8-to-istanbul0.3→1.0,es-module-lexer1.7→2.3,obugnew;vite-node,tinypool,tinyspy,loupe,test-exclude,istanbul-lib-source-mapsdropped. Vitest 4'sviterange^6 || ^7 || ^8and@types/node >=24are both satisfied by what's already installed. - Also in the lock diff, unrelated to Vitest: the workspace
versionfields move0.8.14 → 0.8.33and the CLI gains thehyperframes-localize-fontsbin. Both already matchpackage.jsononmain; the lockfile was simply stale and this install caught it up. Harmless, noting it so nobody hunts for the commit that "bumped" packages. - Suites under Vitest 4.1.11 at this head: CLI
remote.test.ts28/28; corecaptionOverrides+mediaProxy48/48; player 148/148; the seven changed Studio files plus the twoconfirm-stubbing suites 162/162. - Every shim is load-bearing (mutation, then restored): drop both
.mockClear()→ 3 red; dropvi.clearAllMocks()in the two core files → 8 red; oneAudiomock back to an arrow → 6 red (not a constructor);Imagemock back to an arrow → 1 red; drop theconfirmfallback → 4 red (can only spy on a function). No test skipped, no assertion or threshold changed. vi.clearAllMocks()is inafterEachonly, so it affects cross-test isolation, not intra-test call ordering; both files assert within a test.- Producer AAC loudness:
audioPadTrim.integration.test.tspasses onmainunder Vitest 3 in my environment (3.5 s), so I can't reproduce the local 3.9 LU reading either way. It is an ffmpeg-build-dependent measurement, the test is untouched by this PR, and theTestlane is green at this head, so I'm treating it as environmental rather than a regression. - CI: all 8 required checks pass at
e4fe6d79(Build, Typecheck, Test, Test: runtime contract, Tests on windows-latest, Render on windows-latest, regression, Semantic PR title). The earlier "fail" rows were the cancelled runs superseded by this push.
Nits (non-blocking)
packages/studio/tsconfig.json:20—types: ["vite/client", "node"]widens the type environment for the whole browser package (and, viatsconfig.lib.json, the d.ts build), so browser code that accidentally reaches forprocess/Buffernow typechecks. A test-only tsconfig or a/// <reference types="node" />intest-setup.tswould scope it. Fine to leave for the Vite 8 migration.packages/core/src/runtime/mediaProxy.test.ts:61—vi.restoreAllMocks()moved above the DOM cleanup; harmless, just noting it's an ordering change rather than an addition.
Verdict: APPROVE
Reasoning: Security bump lands with a single resolved Vitest 4 tree and no non-test source change; every compatibility shim is necessary (proven by mutation) and preserves the original assertions; all required checks green at this head.
— Miga
|
@miga-heygen Thanks for the exact-head approval. All replacement CI runs are green and there are no unresolved threads at e4fe6d7. Please explicitly confirm acceptance of the Fallow inherited findings and duplication warnings disclosed in the PR description, or identify anything requiring a fix. This is the remaining review gate before protected merge. Your Node-type scope and cleanup-order nits are recorded as nonblocking. |
|
Confirming, with the audit re-run rather than from the description. I ran the CI invocation (
Accepted. Nothing here requires a fix before merge: the inherited findings are untouched by this PR, the single "introduced" group is an attribution artifact of the type rename, and duplication is warn-level in this repo's gate. If anyone wants the — Miga |
Upgrades Vitest to 4.1.11 across all 13 manifests affected by GHSA-82fw-gwwq-j7x9 (Dependabot alerts #21–#33), and aligns
@vitest/coverage-v8with that version. The installed tree resolves Vitest, mocker and coverage-v8 to 4.1.11.Preserves existing tests under Vitest 4 by using constructable Audio/Image mocks, explicit mock types, explicit mock-history cleanup, a test-only confirm fallback, and explicit Node types in Studio. No production behavior, test assertions, coverage thresholds, Vite or React plugin versions change. The relevant Studio test/type fixes were selectively backported from #3620; its separate Vite 8 migration remains out of scope.
Validation:
The first unrestricted local parallel run was discarded due to machine contention. Results above use capped workers. Native CI and independent review are required before merge; verify Dependabot closes all 13 alerts after landing.