-
Notifications
You must be signed in to change notification settings - Fork 620
refactor: update tests from Jest to Vitest #6335
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
|
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 test files from Jest to Vitest as part of a broader testing framework transition. The changes update test imports, configuration files, and snapshot formats to be compatible with Vitest while maintaining the same test functionality.
Key changes include:
- Adding Vitest imports (
describe
,it
,expect
) to test files - Updating Jest configuration and Vitest configuration to include newly migrated test paths
- Converting Jest snapshot format to Vitest snapshot format
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/react/vitest.config.browser.mts | Added test paths for Hidden and deprecated components, reordered existing paths alphabetically |
packages/react/jest.config.js | Added corresponding test paths and reordering to match Vitest config |
packages/react/src/deprecated/utils/createSlots.test.tsx | Added Vitest imports and reordered React import |
packages/react/src/deprecated/utils/snapshots/createSlots.test.tsx.snap | Updated snapshot format from Jest to Vitest |
packages/react/src/deprecated/UnderlineNav/UnderlineNavLink.test.tsx | Migrated from custom testing utils to standard testing-library with Vitest imports |
packages/react/src/deprecated/UnderlineNav/UnderlineNav.test.tsx | Migrated from custom testing utils to standard testing-library, removed accessibility tests |
packages/react/src/Hidden/snapshots/Hidden.test.tsx.snap | Updated snapshot format and class name expectations |
packages/react/src/Hidden/Hidden.test.tsx | Simplified test file by removing custom testing utilities and accessibility checks |
import axe from 'axe-core' | ||
import {render} from '@testing-library/react' | ||
import {describe, it, expect} from 'vitest' | ||
import UnderlineNav from '../UnderlineNav' |
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.
The import path '../UnderlineNav' is inconsistent with the original import pattern. It should be 'import {UnderlineNav} from '../../deprecated'' to maintain consistency with the UnderlineNavLink test file and ensure the correct component is imported.
import UnderlineNav from '../UnderlineNav' | |
import {UnderlineNav} from '../../deprecated' |
Copilot uses AI. Check for mistakes.
👋 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 📦
|
Part of: https://github.com/github/primer/issues/5336
Changelog
New
Changed
Removed
Rollout strategy