Skip to content

refactor: update live-region and utils tests from Jest to Vitest #6157

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

Merged
merged 2 commits into from
Jun 3, 2025

Conversation

joshblack
Copy link
Member

@joshblack joshblack commented Jun 2, 2025

Update live region and utils test from Jest to Vitest

Changelog

New

Changed

  • Update live region tests to Vitest
  • Update utils tests for warning and invariant to Vitest

Removed

Copy link

changeset-bot bot commented Jun 2, 2025

⚠️ No Changeset found

Latest commit: d419423

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

Copy link
Contributor

github-actions bot commented Jun 2, 2025

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

@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 Jun 2, 2025
Copy link
Contributor

github-actions bot commented Jun 2, 2025

size-limit report 📦

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

@joshblack joshblack added the skip changeset This change does not need a changelog label Jun 2, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6157 June 2, 2025 19:18 Inactive
@joshblack joshblack marked this pull request as ready for review June 3, 2025 15:51
@Copilot Copilot AI review requested due to automatic review settings June 3, 2025 15:51
@joshblack joshblack requested a review from a team as a code owner June 3, 2025 15:51
@joshblack joshblack requested a review from francinelucca June 3, 2025 15:51
@joshblack joshblack enabled auto-merge June 3, 2025 15:51
Copy link
Contributor

@Copilot 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 live-region and utils tests from Jest to Vitest and updates related configs and helpers.

  • Added Vitest matching patterns for live-region and utils tests
  • Converted warning and invariant tests to use Vitest APIs and wrapped them in describe blocks
  • Introduced a test-helpers.ts for live-region tests and updated Aria component tests accordingly
  • Updated Jest config to exclude/match the new test locations

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
vitest.config.mts Added patterns for live-region and utils tests
src/utils/tests/warning.test.ts Replaced jest.spyOn with vi.spyOn, added describe wrapper
src/utils/tests/invariant.test.ts Added Vitest imports and describe wrapper
src/live-region/tests/test-helpers.ts New helper to query the live-region element
src/live-region/tests/*.test.tsx Updated imports to Vitest, use local test-helpers, adjusted style assertions
jest.config.js Added live-region & utils tests to Jest matching patterns

@joshblack joshblack added this pull request to the merge queue Jun 3, 2025
Merged via the queue into main with commit 0e04210 Jun 3, 2025
36 checks passed
@joshblack joshblack deleted the refactor/update-tests-to-vitest-jun-2 branch June 3, 2025 17:40
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.

2 participants