chore(deps): upgrade vitest and coverage provider to 4#1689
Merged
Conversation
vitest 4 mocks with arrow-function implementations are no longer
constructable; observer tests mocked ResizeObserver and
IntersectionObserver constructors via 'vi.fn((cb) => ({...}))' and
failed with 'is not a constructor'. Implementations extracted to
function declarations, which stay constructable and do not trip
prefer-arrow-callback.
Config needed no changes; coverage output format is unchanged.
Node >= 25 defines global localStorage/sessionStorage; without --localstorage-file they are non-functional stubs, and under vitest 4 they shadow jsdom's storage in test workers -- the storage-event tests failed with 'Cannot read properties of undefined (reading getItem)'. - vitest workers now run with --no-experimental-webstorage (vitest 4 moved execArgv from poolOptions to a top-level test option) - storage-event tests reference storage explicitly via window.localStorage / window.sessionStorage Also unblocks re-adding Node 'latest' to the CI test matrix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrades
vitestand@vitest/coverage-v83.2.4 → 4.1.10.Compat fixes:
ResizeObserver/IntersectionObserverconstructors viavi.fn((cb) => ({...}))and failed withis not a constructor(16 tests across 3 files). Implementations extracted to function declarations.localStorage/sessionStorage— non-functional stubs without--localstorage-file— and under vitest 4 they shadow jsdom's storage in test workers, failing 3useStorageValuestorage-event tests. Test workers now run with--no-experimental-webstorage(vitest 4 movedexecArgvto a top-level test option) and the tests referencewindow.localStorageexplicitly. This also unblocks re-adding Nodelatestto the CI matrix.vitest.config.tsotherwise unchanged; coverage works (98.23% statements).Rebased onto master independently of the eslint 10 PR (#1688 parked pending the oxc migration decision).
Verification: lint 0 problems (eslint 9), build clean, 527/527 tests pass, coverage runs.