-
-
Notifications
You must be signed in to change notification settings - Fork 9
Use vitest browser #2990
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
base: main
Are you sure you want to change the base?
Use vitest browser #2990
Conversation
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.
Pull request overview
This PR migrates the testing infrastructure from jsdom-based testing with @testing-library/react to Vitest's browser mode using Playwright and vitest-browser-react. This enables running tests in a real browser environment instead of a simulated DOM.
- Removes
@testing-library/react,@testing-library/dom, andjsdomdependencies - Adds
@vitest/browser-playwright,vitest-browser-react, and Playwright for browser-based testing - Updates test files to use async/await pattern required by browser-based testing
- Adds browser environment setup including process.env polyfill for Next.js internals
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Updates dependencies: removes testing-library packages and jsdom, adds vitest browser packages and playwright; marks jsdom dependencies as optional |
| apps/web/vitest.config.mts | Replaces jsdom environment with browser mode configuration using Playwright provider |
| apps/web/package.json | Updates devDependencies to remove testing-library packages and add vitest browser packages |
| apps/web/lib/use-stable-array.test.ts | Converts tests to async/await, updates import from @testing-library/react to vitest-browser-react, adds non-null assertions for renderHook parameters |
| apps/web/lib/next.mock.ts | Adds browser environment polyfills for server-only mock and process.env for Next.js internals |
| apps/web/components/Time/countdown.test.tsx | Converts tests to async/await, updates import to vitest-browser-react, adds test case numbering for better identification |
| apps/web/components/Time/snapshots/countdown.test.tsx.snap | Updates snapshots with new test names, different CSS class hashes, and removes trailing commas from fragments |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d6836e8 to
41c3680
Compare
41c3680 to
83a6a05
Compare
No description provided.