chore: upgrade vitest#1291
Open
arkadiy93 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Upgrades the repo’s Vitest setup to v4.x (including browser testing) and adapts configs/tests/mocks to the updated Vitest APIs so the test suite continues to run under the new version.
Changes:
- Bump
vitest,@vitest/browser, and@vitest/coverage-v8to^4.1.8and add@vitest/browser-playwright. - Update
vitest.config.tsto use the new Playwright provider API (playwright()). - Adjust multiple tests to the new Vitest timeout/options argument placement and extend jsdom mocks (e.g.,
scrollTo).
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Switch browser provider config to @vitest/browser-playwright (playwright()) for Vitest v4 browser mode. |
| src/tests/browserMocks.ts | Refine browser API mocks (Resize/IntersectionObserver as classes) and add scrollTo stub for jsdom. |
| src/providers/TableOfContentsProvider.jsdom.test.tsx | Update test timeout/options argument ordering for Vitest v4. |
| src/organisms/TopBar/Resources/Resources.test.tsx | Update test timeout/options argument ordering for Vitest v4. |
| src/organisms/TopBar/ApplicationDrawer/ApplicationDrawer.test.tsx | Update test timeout/options argument ordering for Vitest v4. |
| src/organisms/TopBar/Account/ImpersonateMenu/DeleteUser/DeleteUser.test.tsx | Update test timeout/options argument ordering for Vitest v4. |
| src/organisms/TopBar/Account/ImpersonateMenu/CreateOrEditUser/CreateOrEditUser.test.tsx | Update sequential tests and parameterized tests to Vitest v4 options signature. |
| src/organisms/TopBar/Account/Account.test.tsx | Update suite/test option placement to align with Vitest v4 signatures. |
| public/mockServiceWorker.js | Update MSW worker PACKAGE_VERSION (but see review comment re: integrity checksum). |
| package.json | Bump Vitest-related dev dependencies and add @vitest/browser-playwright. |
| bun.lock | Lockfile updates for the new Vitest/browser/coverage dependency graph. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Coverage Report
File CoverageNo changed files found. |
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.
https://github.com/equinor/amplify-component-lib/security/dependabot/72