Bump vitest to 4.1.0 to resolve Dependabot alerts#85
Merged
Conversation
Upgrades vitest from ^3.0.0 to ^4.1.0 across the shared and extension packages, resolving the critical Dependabot alerts (#14, #15, #16). Adjusts tests for vitest 4 behavior changes: - Mocked constructors must use a regular function implementation (arrow functions are not constructable when invoked with `new`). - vi.fn() now infers a constructable signature, so handler mocks are typed explicitly and chrome API stub assignments are cast.
Merged
dantraynor
added a commit
that referenced
this pull request
Jun 4, 2026
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.
Summary
Upgrades
vitestfrom^3.0.0to^4.1.0in thesharedandextensionpackages, resolving the 3 open critical Dependabot alerts (#14, #15, #16 — allvitest < 4.1.0).viteis already pinned to^7.3.2via the rootpnpm.overrides, so vitest 4 (which requires vite 6/7) is compatible.Test changes for vitest 4
The major bump required two small adjustments to the test code:
new, vitest 4 constructs via the implementation, and an arrow function isn't constructable. Switched theFirefoxProxyManagermock implementation to afunction.vi.fn()now infers a constructable signature, so a barevi.fn()no longer satisfies a plain call-signature type. Typed the native-host handler mocks explicitly (Mock<NativeMessageHandler>/Mock<NativeStateChangeHandler>) and cast thechrome.*API stub assignments (matching the existingconnectNativecast style).Verification
pnpm -r test→ 339 tests passing (293 shared + 46 extension) on vitest 4.1.8pnpm -r typecheck→ clean