Skip to content
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

chore: bump jest to version 29 #12662

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
4,522 changes: 3,378 additions & 1,144 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"get-port": "^5.1.1",
"globby": "^11.0.4",
"husky": "^4.3.8",
"jest": "^27.4.3",
"jest": "^28.1.3",
"lerna": "^4.0.0",
"lerna-changelog": "^2.2.0",
"lint-staged": "^12.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-named-asset-import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"devDependencies": {
"babel-plugin-tester": "^10.1.0",
"jest": "^27.4.3"
"jest": "^28.1.3"
},
"scripts": {
"test": "jest"
Expand Down
2 changes: 1 addition & 1 deletion packages/confusing-browser-globals/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
"index.js"
],
"devDependencies": {
"jest": "^27.4.3"
"jest": "^28.1.3"
}
}
2 changes: 1 addition & 1 deletion packages/create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
},
"devDependencies": {
"cross-env": "^7.0.3",
"jest": "^27.4.3"
"jest": "^28.1.3"
}
}
2 changes: 1 addition & 1 deletion packages/react-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
},
"devDependencies": {
"cross-env": "^7.0.3",
"jest": "^27.4.3"
"jest": "^28.1.3"
},
"scripts": {
"test": "cross-env FORCE_COLOR=true jest"
Expand Down
5 changes: 3 additions & 2 deletions packages/react-error-overlay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@
"@babel/code-frame": "^7.16.0",
"@babel/core": "^7.16.0",
"anser": "^2.1.0",
"babel-jest": "^27.4.2",
"babel-jest": "^28.1.3",
"babel-loader": "^8.2.3",
"babel-preset-react-app": "^10.0.1",
"chalk": "^4.1.2",
"chokidar": "^3.5.2",
"cross-env": "^7.0.3",
"flow-bin": "^0.116.0",
"html-entities": "^2.3.2",
"jest": "^27.4.3",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to installed separately from jest
https://jestjs.io/fr/docs/upgrading-to-jest28#jsdom

"jest-fetch-mock": "^3.0.3",
"object-assign": "^4.1.1",
"promise": "^8.1.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/react-scripts/config/jest/cssTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

module.exports = {
process() {
return 'module.exports = {};';
return {
code: 'module.exports = {};',
};
},
Comment on lines 15 to 19
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning string isn't allowed anymore with v28

https://jestjs.io/docs/upgrading-to-jest28#transformer

getCacheKey() {
// The output is always the same.
Expand Down
10 changes: 7 additions & 3 deletions packages/react-scripts/config/jest/fileTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ module.exports = {
pascalCase: true,
});
const componentName = `Svg${pascalCaseFilename}`;
return `const React = require('react');
return {
code: `const React = require('react');
module.exports = {
__esModule: true,
default: ${assetFilename},
Expand All @@ -32,9 +33,12 @@ module.exports = {
})
};
}),
};`;
};`,
};
}

return `module.exports = ${assetFilename};`;
return {
code: `module.exports = ${assetFilename};`,
};
},
};
2 changes: 1 addition & 1 deletion packages/react-scripts/fixtures/kitchensink/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"package": {
"dependencies": {
"bootstrap": "4.3.1",
"jest": "27.1.0",
"jest": "28.1.3",
"node-sass": "6.x",
"normalize.css": "7.0.0",
"prop-types": "15.7.2",
Expand Down
9 changes: 5 additions & 4 deletions packages/react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@babel/core": "^7.16.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
"@svgr/webpack": "^5.5.0",
"babel-jest": "^27.4.2",
"babel-jest": "^28.1.3",
"babel-loader": "^8.2.3",
"babel-plugin-named-asset-import": "^0.3.8",
"babel-preset-react-app": "^10.0.1",
Expand All @@ -50,9 +50,10 @@
"fs-extra": "^10.0.0",
"html-webpack-plugin": "^5.5.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^27.4.3",
"jest-resolve": "^27.4.2",
"jest-watch-typeahead": "^1.0.0",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"jest-resolve": "^28.1.3",
"jest-watch-typeahead": "^2.0.0",
"mini-css-extract-plugin": "^2.4.5",
"postcss": "^8.4.4",
"postcss-flexbugs-fixes": "^5.0.2",
Expand Down