-
Notifications
You must be signed in to change notification settings - Fork 646
Update Portal tests from Jest to Vitest #6391
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
|
Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
|
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
size-limit report 📦
|
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 Portal component tests from Jest to Vitest as part of the broader test suite migration effort. The changes ensure Portal tests run exclusively with Vitest while maintaining test functionality.
Key changes:
- Added Portal test path to Vitest configuration to include Portal tests in the Vitest test runner
- Excluded Portal tests from Jest configuration to prevent duplicate test execution
- Updated Portal test file with explicit Vitest imports for test functions
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/react/vitest.config.browser.mts | Added Portal test path to Vitest include array |
| packages/react/src/Portal/Portal.test.tsx | Added explicit Vitest imports for test functions |
| packages/react/jest.config.js | Added Portal directory to Jest modulePathIgnorePatterns |
This PR migrates the Portal component tests from Jest to Vitest as part of the broader test suite migration effort.
Changes Made
vitest.config.browser.mts: Added'src/Portal/**/*.test.?(c|m)[jt]s?(x)'to the include array to run Portal tests with Vitestjest.config.js: Added'<rootDir>/src/Portal/'to the modulePathIgnorePatterns to exclude Portal tests from JestPortal.test.tsx: Addedimport {describe, expect, it} from 'vitest'to explicitly import test functions from VitestMigration Details
The Portal tests were already in good shape for migration:
renderfrom@testing-library/reactbehavesAsComponentusage to removecheckExportsusage to removetoHaveNoViolationsassertions to removesetupMatchMediausage to removeit.skiptests to enableAll 5 Portal tests are now passing with Vitest and Jest no longer runs these tests.
Fixes #6388.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.