-
Notifications
You must be signed in to change notification settings - Fork 5
chore: Update vite & vitest dependencies to latest versions #717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
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:
|
|
@SocketSecurity ignore-all |
0129d08 to
65ee112
Compare
| 'vitest/no-alias-methods': 'off', | ||
| 'vitest/prefer-called-exactly-once-with': 'off', |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
packages/cli/src/file.test.ts
Outdated
| beforeEach(() => { | ||
| mocks.access.mockClear(); | ||
| mocks.lstat.mockClear(); | ||
| mocks.copyFile.mockClear(); | ||
| }); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| // Make the mocked MessageQueue behave like a real FIFO queue so the test | ||
| // models actual behavior: failed sends enqueue messages, and flush dequeues them. |
There was a problem hiding this comment.
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?
rekmarks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
luhguhddame!
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.
vitestto^4.0.16,viteto^7.3.0, updates@vitest/*,@vitejs/*,vite-tsconfig-paths, andjsdomacross packagesstreamsto Vitest Browser with Playwright (@vitest/browser-playwright) and updates config (vitest.config.ts) accordinglytoThrowwithtoThrowError, convert constructor mocks tofunctionimplementations, addbeforeEachmockClear, and adjust call assertions (e.g.,haveBeenCalledExactlyOnceWith)kernel-shims/endoify-repairand setsLOCKDOWN_ERROR_TRAPPING: 'none'in Node E2E Vitest config to avoid process.exit during testsvitest/*rules) and tweaks timeouts/thresholds in tests and rootvitest.config.tsWritten by Cursor Bugbot for commit b6d2104. This will update automatically on new commits. Configure here.