-
Notifications
You must be signed in to change notification settings - Fork 622
refactor: update tests to vitest, move all component tests to folders #6018
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
|
👋 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! |
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 component test suites from Jest to Vitest and reorganizes test file locations.
- Migrated
ActionBar
,AnchoredOverlay
,ToggleSwitch
,Truncate
, andUnderlineNav
tests from Jest to Vitest. - Moved component tests out of
src/__tests__
into their respective component folders. - Updated snapshot headers and class/hash outputs for Vitest compatibility.
Reviewed Changes
Copilot reviewed 54 out of 54 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/react/src/CounterLabel/CounterLabel.types.test.tsx | Removed TS type test functions and cleaned up unused imports |
packages/react/src/AnchoredOverlay/snapshots/AnchoredOverlay.test.tsx.snap | Updated snapshot format, class hashes, and inline style values |
packages/react/src/AnchoredOverlay/AnchoredOverlay.test.tsx | Replaced Jest utilities with Vitest imports, removed legacy tests |
packages/react/src/ActionBar/ActionBar.test.tsx | Switched to Vitest, updated testing-library usage, dropped Axe tests |
packages/react/jest.config.js | Updated modulePathIgnorePatterns to ignore migrated test folders |
Comments suppressed due to low confidence (3)
packages/react/src/CounterLabel/CounterLabel.types.test.tsx:10
- Tests for ref forwarding and custom span prop acceptance were removed. Consider reintroducing
showAcceptARef
andshouldPassThroughSpanProps
to maintain verification of these typings.
export function showAcceptARef() {
packages/react/src/AnchoredOverlay/AnchoredOverlay.test.tsx:3
- Axe accessibility tests were removed in this migration. Reintroduce accessibility checks or an equivalent approach to preserve a11y coverage for
AnchoredOverlay
.
import {AnchoredOverlay} from '../AnchoredOverlay'
packages/react/src/ActionBar/ActionBar.test.tsx:2
- Accessibility (axe) test cases were removed. Ensure you add back accessibility validations to catch regressions in the
ActionBar
component.
import {describe, expect, it, afterEach, vi} from 'vitest'
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.
nice 🤘🏻
This PR continues our move to vitest by migrating several components from Jest to Vitest. This also moves component tests that were defined in
src/__tests__
to their respective component folder.Changelog
New
Changed
Removed
Rollout strategy
This is a change to our internal testing structure