-
Notifications
You must be signed in to change notification settings - Fork 1.3k
deps: upgrade jest, replace deprecated api #4190
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
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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 Jest from version 29.7.0 to 30.2.0 and replaces deprecated Jest matcher APIs with their current equivalents. The changes also include upgrading related testing libraries and converting Jest configuration files to ES modules format.
Key changes:
- Upgraded Jest and testing libraries to latest versions
- Replaced deprecated Jest API methods (e.g.,
toBeCalled()→toHaveBeenCalled()) - Converted Jest config files from CommonJS to ES modules
- Updated test assertions across all test files
Reviewed changes
Copilot reviewed 17 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Upgraded Jest from 29.7.0 to 30.2.0, @testing-library/jest-dom from ^5.16.5 to ^6.9.1, @testing-library/react from ^14.2.1 to ^16.3.0, @types/jest from ^29.5.2 to ^30.0.0, and @edge-runtime/jest-environment from ^3.0.4 to ^4.0.0. Added @testing-library/dom ^10.4.1. |
| pnpm-lock.yaml | Updated lock file with all dependency changes and their transitive dependencies |
| jest.config.js | Converted from CommonJS module.exports to ES module export default, changed transform array syntax to string, removed trailing commas |
| jest.config.build.js | Converted from CommonJS require/module.exports to ES module import/export syntax |
| tsconfig.json | Added jest.config.js to include array for TypeScript checking |
| test/*.test.tsx | Replaced deprecated Jest matchers: toBeCalled() → toHaveBeenCalled(), toBeCalledTimes() → toHaveBeenCalledTimes(), toReturnWith() → toHaveReturnedWith(), nthCalledWith() → toHaveBeenNthCalledWith(). Minor formatting improvements (semicolons, line breaks). |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Copilot reviewed 17 out of 20 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
package.json
Outdated
| "lint-staged": "16.2.7", | ||
| "next": "16.0.10", | ||
| "jest": "30.2.0", | ||
| "jest-environment-jsdom": "29.7.0", "lint-staged": "16.2.7", |
Copilot
AI
Jan 4, 2026
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.
There's a syntax error in the package.json file. Line 152 is missing proper JSON formatting - it has two keys on the same line without a comma separator. The line should be split into:
"jest-environment-jsdom": "29.7.0",
"lint-staged": "16.2.7",
| "jest-environment-jsdom": "29.7.0", "lint-staged": "16.2.7", | |
| "jest-environment-jsdom": "29.7.0", | |
| "lint-staged": "16.2.7", |
update edge runtime fix json format
Note: i did not upgrade 'jest-environment-jsdom' because it does not allow us to spy on window method anymore.
