Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 24, 2025

This PR migrates the Portal component tests from Jest to Vitest as part of the broader test suite migration effort.

Changes Made

  • Updated vitest.config.browser.mts: Added 'src/Portal/**/*.test.?(c|m)[jt]s?(x)' to the include array to run Portal tests with Vitest
  • Updated jest.config.js: Added '<rootDir>/src/Portal/' to the modulePathIgnorePatterns to exclude Portal tests from Jest
  • Updated Portal.test.tsx: Added import {describe, expect, it} from 'vitest' to explicitly import test functions from Vitest

Migration Details

The Portal tests were already in good shape for migration:

  • ✅ Already using render from @testing-library/react
  • ✅ No behavesAsComponent usage to remove
  • ✅ No checkExports usage to remove
  • ✅ No toHaveNoViolations assertions to remove
  • ✅ No setupMatchMedia usage to remove
  • ✅ No it.skip tests to enable

All 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.

@changeset-bot
Copy link

changeset-bot bot commented Jul 24, 2025

⚠️ No Changeset found

Latest commit: fd4f0cf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Portal tests from Jest to Vitest Update Portal tests from Jest to Vitest Jul 24, 2025
Copilot AI requested a review from joshblack July 24, 2025 23:11
Copilot finished work on behalf of joshblack July 24, 2025 23:11
@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Jul 24, 2025
@github-actions
Copy link
Contributor

👋 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!

@joshblack joshblack added the skip changeset This change does not need a changelog label Jul 24, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jul 24, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 92.21 KB (0%)
packages/react/dist/browser.umd.js 92.39 KB (0%)

@github-actions github-actions bot temporarily deployed to storybook-preview-6391 July 24, 2025 23:22 Inactive
@joshblack joshblack marked this pull request as ready for review July 24, 2025 23:23
Copilot AI review requested due to automatic review settings July 24, 2025 23:23
@joshblack joshblack requested a review from a team as a code owner July 24, 2025 23:23
Copy link
Contributor

Copilot AI left a 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

@joshblack joshblack merged commit ec4d3cb into main Jul 25, 2025
66 of 87 checks passed
@joshblack joshblack deleted the copilot/fix-6388 branch July 25, 2025 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm skip changeset This change does not need a changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Portal tests from Jest to Vitest

3 participants