Skip to content

Conversation

@sirtimid
Copy link
Contributor

@sirtimid sirtimid commented Jan 5, 2026

Updates all vite-related dependencies (vite, vitest, @vitest/, @vitejs/, jsdom) across the monorepo and migrates to Vitest 4.0. Fixes breaking changes including browser testing configuration for the streams package, constructor mocks (changed arrow functions to function declarations), mock state persistence (added mockClear in beforeEach), and ESLint errors related to promise-returning mocks.


Note

Modernizes test/build stack and applies required migrations for Vitest 4.

  • Bumps vitest to ^4.0.16, vite to ^7.3.0, updates @vitest/*, @vitejs/*, vite-tsconfig-paths, and jsdom across packages
  • Switches browser tests in streams to Vitest Browser with Playwright (@vitest/browser-playwright) and updates config (vitest.config.ts) accordingly
  • Adapts tests to Vitest 4 API changes: replace toThrow with toThrowError, convert constructor mocks to function implementations, add beforeEach mockClear, and adjust call assertions (e.g., haveBeenCalledExactlyOnceWith)
  • Adds SES lockdown error trapping control in kernel-shims/endoify-repair and sets LOCKDOWN_ERROR_TRAPPING: 'none' in Node E2E Vitest config to avoid process.exit during tests
  • Updates ESLint config for Vitest 4 (temporarily disables new vitest/* rules) and tweaks timeouts/thresholds in tests and root vitest.config.ts

Written by Cursor Bugbot for commit b6d2104. This will update automatically on new commits. Configure here.

@sirtimid sirtimid requested a review from a team as a code owner January 5, 2026 20:27
@sirtimid sirtimid changed the title chore: Upgrade vitest to v4 chore: Update vite & vitest dependencies to latest versions Jan 5, 2026
@socket-security
Copy link

socket-security bot commented Jan 5, 2026

@socket-security
Copy link

socket-security bot commented Jan 5, 2026

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • bidi-js@1.0.3
  • pngjs@7.0.0
  • mdn-data@2.12.2
  • css-tree@3.1.0
  • pixelmatch@7.1.0
  • @asamuzakjp/nwsapi@2.3.9
  • @babel/helper-globals@7.28.0
  • parse5@8.0.0
  • @jridgewell/remapping@2.3.5
  • obug@2.1.1
  • @rolldown/pluginutils@1.0.0-beta.53
  • @asamuzakjp/dom-selector@6.7.6
  • @standard-schema/spec@1.1.0
  • @vitest/browser-playwright@4.0.16
  • esbuild@0.27.2
  • @esbuild/openharmony-arm64@0.27.2
  • @esbuild/linux-ia32@0.27.2
  • @esbuild/android-x64@0.27.2
  • @esbuild/android-arm@0.27.2
  • @esbuild/win32-arm64@0.27.2
  • @esbuild/android-arm64@0.27.2
  • @esbuild/netbsd-x64@0.27.2
  • @esbuild/netbsd-arm64@0.27.2
  • @esbuild/linux-riscv64@0.27.2
  • @esbuild/openbsd-x64@0.27.2
  • @esbuild/linux-ppc64@0.27.2
  • @esbuild/linux-x64@0.27.2
  • @esbuild/linux-loong64@0.27.2
  • @esbuild/sunos-x64@0.27.2
  • @esbuild/linux-s390x@0.27.2
  • @esbuild/linux-arm@0.27.2
  • @esbuild/aix-ppc64@0.27.2
  • @esbuild/win32-x64@0.27.2
  • @esbuild/openbsd-arm64@0.27.2
  • @esbuild/freebsd-arm64@0.27.2
  • @esbuild/freebsd-x64@0.27.2
  • @esbuild/win32-ia32@0.27.2
  • @esbuild/linux-mips64el@0.27.2
  • @esbuild/darwin-x64@0.27.2
  • @esbuild/linux-arm64@0.27.2
  • @esbuild/darwin-arm64@0.27.2
  • @csstools/css-syntax-patches-for-csstree@1.0.22
  • @acemir/cssom@0.9.30
  • @exodus/bytes@1.8.0
  • @babel/helper-plugin-utils@7.27.1
  • @babel/code-frame@7.27.1
  • @babel/helper-validator-option@7.27.1
  • @babel/helper-module-imports@7.27.1
  • @babel/plugin-transform-react-jsx-self@7.27.1
  • @babel/plugin-transform-react-jsx-source@7.27.1
  • @babel/helper-compilation-targets@7.27.2
  • @babel/template@7.27.2
  • @csstools/css-calc@2.1.4
  • @csstools/css-parser-algorithms@3.0.5
  • @csstools/css-tokenizer@3.0.4
  • decimal.js@10.6.0
  • @jridgewell/gen-mapping@0.3.13
  • @jridgewell/sourcemap-codec@1.5.5
  • @babel/helper-module-transforms@7.28.3
  • fdir@6.5.0
  • tough-cookie@6.0.0
  • istanbul-reports@3.2.0
  • @csstools/color-helpers@5.1.0
  • @csstools/css-color-parser@3.1.0
  • sirv@3.0.2
  • @babel/helpers@7.28.4
  • tinyglobby@0.2.15
  • tinyrainbow@3.0.3
  • data-urls@6.0.0
  • whatwg-url@15.1.0
  • tr46@6.0.0
  • react-refresh@0.18.0
  • std-env@3.10.0
  • @babel/compat-data@7.28.5
  • @babel/types@7.28.5
  • @babel/parser@7.28.5
  • @babel/generator@7.28.5
  • @babel/helper-validator-identifier@7.28.5
  • @babel/traverse@7.28.5
  • @babel/core@7.28.5
  • magic-string@0.30.21
  • magicast@0.5.1
  • tinyexec@1.0.2
  • tldts-core@7.0.19
  • tldts@7.0.19
  • lru-cache@11.2.4
  • @vitejs/plugin-react@5.1.2
  • expect-type@1.3.0
  • vite@7.3.0
  • @asamuzakjp/css-color@4.1.1
  • vitest@4.0.16
  • @vitest/utils@4.0.16
  • @vitest/spy@4.0.16
  • @vitest/pretty-format@4.0.16
  • @vitest/snapshot@4.0.16
  • @vitest/expect@4.0.16
  • @vitest/mocker@4.0.16
  • @vitest/runner@4.0.16
  • @vitest/browser@4.0.16
  • @vitest/coverage-v8@4.0.16
  • vite-tsconfig-paths@6.0.3
  • chai@6.2.2
  • html-encoding-sniffer@6.0.0
  • jsdom@27.4.0
  • ast-v8-to-istanbul@0.3.10
  • @typescript-eslint/tsconfig-utils@8.51.0
  • @typescript-eslint/visitor-keys@8.51.0
  • @typescript-eslint/scope-manager@8.51.0
  • @typescript-eslint/typescript-estree@8.51.0
  • @typescript-eslint/utils@8.51.0
  • @typescript-eslint/project-service@8.51.0
  • @typescript-eslint/types@8.51.0
  • caniuse-lite@1.0.30001762
  • cssstyle@5.3.6
  • webidl-conversions@8.0.1
  • ts-api-utils@2.4.0
  • @vitest/eslint-plugin@1.6.5

View full report

@sirtimid
Copy link
Contributor Author

sirtimid commented Jan 5, 2026

@SocketSecurity ignore-all

@sirtimid sirtimid force-pushed the sirtimid/deps-vitest-4 branch from 0129d08 to 65ee112 Compare January 5, 2026 20:32
Comment on lines +134 to +135
'vitest/no-alias-methods': 'off',
'vitest/prefer-called-exactly-once-with': 'off',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume these are new. Are they good? Should we add TODOs to enable them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment that these are temporary and should be removed when @metamask/eslint-config-vitest is updated

Comment on lines 27 to 31
beforeEach(() => {
mocks.access.mockClear();
mocks.lstat.mockClear();
mocks.copyFile.mockClear();
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now have to do some of this manually? Seems like an unfortunate regression.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I can add clearMocks: true to prevent this (In Vitest 4, restoreMocks only restores spies created with vi.spyOn(), not mocks created with vi.fn()) I'll change it.

Comment on lines +671 to +672
// Make the mocked MessageQueue behave like a real FIFO queue so the test
// models actual behavior: failed sends enqueue messages, and flush dequeues them.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mock implementation is pretty complex and makes the test harder to understand. Can we move the setup into a function stored elsewhere in the file?

Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

luhguhddame!

@sirtimid sirtimid merged commit dfeb7ad into main Jan 7, 2026
26 checks passed
@sirtimid sirtimid deleted the sirtimid/deps-vitest-4 branch January 7, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants