-
Notifications
You must be signed in to change notification settings - Fork 56
Upgrade dependencies to fix security vulnerability #1198
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
|
🟢 No design token changes found |
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 upgrades several dependencies to address a critical security vulnerability (Dependabot #325) related to the form-data package. The upgrade requires a major version bump of Jest from v29 to v30, along with related testing infrastructure updates.
Key Changes:
- Upgraded Jest from v29.7.0 to v30.2.0 to resolve transient
form-datavulnerability - Updated test-runner, ts-jest, jest-environment-jsdom, and @figma/code-connect to compatible versions
- Modified test files to accommodate Jest v30 breaking changes (color normalization and deprecated
toThrowErrormethod)
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
package.json |
Bumped jest to ^30.2.0 and ts-jest to ^29.4.5 in root devDependencies |
packages/react/package.json |
Updated @figma/code-connect to ^1.3.10 and jest-environment-jsdom to ^30.2.0 |
apps/storybook/package.json |
Upgraded @storybook/test-runner to ^0.24.1 for Jest v30 compatibility |
packages/react/src/Prose/Prose.test.tsx |
Adapted test for Jest v30 color normalization (with minor issue - see comment) |
packages/react/src/Accordion/Accordion.test.tsx |
Replaced deprecated toThrowError with toThrow |
apps/next-docs/package-lock.json |
Updated dependency tree with new versions and removed obsolete peer dependencies |
Files not reviewed (1)
- apps/next-docs/package-lock.json: Language not supported
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| const customStyle = {color: 'red'} | ||
| const {getByTestId} = render(<Prose data-testid={testId} html={ExampleHtmlMarkup} style={customStyle} />) | ||
| const customStyle = {color: 'rgb(255, 0, 0)'} | ||
| const {getByTestId} = render(<Prose data-testid={testId} html={ExampleHtmlMarkup} style={{color: 'red'}} />) |
Copilot
AI
Nov 25, 2025
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 customStyle variable is now set to the normalized RGB value but is no longer being used in the test. The actual style prop passed to the component is {color: 'red'}, but the assertion checks for {color: 'rgb(255, 0, 0)'}.
This works because Jest v30 normalizes color values, but the customStyle variable should be removed since it's defined but not used. Consider either:
- Passing
customStyleto the component'sstyleprop, OR - Removing the
customStylevariable entirely and inlining the expected value in the assertion
For consistency with the test intent (testing custom styles), option 1 is recommended:
const customStyle = {color: 'rgb(255, 0, 0)'}
const {getByTestId} = render(<Prose data-testid={testId} html={ExampleHtmlMarkup} style={customStyle} />)| const {getByTestId} = render(<Prose data-testid={testId} html={ExampleHtmlMarkup} style={{color: 'red'}} />) | |
| const {getByTestId} = render(<Prose data-testid={testId} html={ExampleHtmlMarkup} style={customStyle} />) |
🟢 Unit test coverage changes foundUnit test coverage has been updated through this PR. Changes: 0 new tests, 0 removed tests, 12 improved, 32 decreased
|
🟢 No visual differences foundOur visual comparison tests did not find any differences in the UI. |
Summary
Resolves https://github.com/primer/brand/security/dependabot/325
Fixes the transient dependency issue correctly, outside of a package-lock update.
The
form-datapackage was used in several packages, and unfortunately required amajorupdate to jest to fix. Tests files were updated according to library guidance.List of notable changes:
@storybook/test-runner,ts-jest,jestand@figma/code-connectSteps to test:
Contributor checklist:
update snapshotslabel to the PR)Reviewer checklist:
Screenshots: