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

Upgrade to Jest 25 #8362

Merged
merged 8 commits into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
833 changes: 447 additions & 386 deletions CHANGELOG-0.x.md

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 @@ -30,7 +30,7 @@
"get-port": "^4.2.0",
"globby": "^9.1.0",
"husky": "^1.3.1",
"jest": "24.9.0",
"jest": "25.5.4",
"lerna": "3.20.2",
"lerna-changelog": "~0.8.2",
"lint-staged": "^8.0.4",
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": "^8.0.1",
"jest": "24.9.0"
"jest": "25.5.4"
},
"scripts": {
"test": "jest"
Expand Down
1 change: 1 addition & 0 deletions packages/babel-preset-react-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Make sure you have a `tsconfig.json` file at the root directory. You can also us
```

## Absolute Runtime Paths

Absolute paths are enabled by default for imports. To use relative paths instead, set the `absoluteRuntime` option in `.babelrc` to `false`:

```
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": "24.9.0"
"jest": "25.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/cra-template-typescript/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@types/node": "^12.0.0",
"@types/react": "^16.9.0",
"@types/react-dom": "^16.9.0",
"@types/jest": "^24.0.0",
"@types/jest": "^25.0.0",
"typescript": "^3.8.0"
}
}
Expand Down
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": "^6.0.3",
"jest": "24.9.0"
"jest": "25.5.4"
},
"scripts": {
"test": "cross-env FORCE_COLOR=true jest"
Expand Down
4 changes: 2 additions & 2 deletions packages/react-error-overlay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@babel/core": "7.9.6",
"anser": "1.4.9",
"babel-eslint": "10.1.0",
"babel-jest": "^24.9.0",
"babel-jest": "^25.2.6",
"babel-loader": "8.1.0",
"babel-preset-react-app": "^9.1.2",
"chalk": "2.4.2",
Expand All @@ -52,7 +52,7 @@
"eslint-plugin-react": "7.19.0",
"flow-bin": "^0.116.0",
"html-entities": "1.3.1",
"jest": "24.9.0",
"jest": "25.5.4",
"jest-fetch-mock": "2.1.2",
"object-assign": "4.1.1",
"promise": "8.1.0",
Expand Down
47 changes: 25 additions & 22 deletions packages/react-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,28 +157,31 @@ module.exports = function(webpackEnv) {
: isEnvDevelopment && 'cheap-module-source-map',
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
entry: isEnvDevelopment && !shouldUseReactRefresh ? [
// Include an alternative client for WebpackDevServer. A client's job is to
// connect to WebpackDevServer by a socket and get notified about changes.
// When you save a file, the client will either apply hot updates (in case
// of CSS changes), or refresh the page (in case of JS changes). When you
// make a syntax error, this client will display a syntax error overlay.
// Note: instead of the default WebpackDevServer client, we use a custom one
// to bring better experience for Create React App users. You can replace
// the line below with these two lines if you prefer the stock client:
//
// require.resolve('webpack-dev-server/client') + '?/',
// require.resolve('webpack/hot/dev-server'),
//
// When using the experimental react-refresh integration,
// the webpack plugin takes care of injecting the dev client for us.
webpackDevClientEntry,
// Finally, this is your app's code:
paths.appIndexJs,
// We include the app code last so that if there is a runtime error during
// initialization, it doesn't blow up the WebpackDevServer client, and
// changing JS code would still trigger a refresh.
] : paths.appIndexJs,
entry:
isEnvDevelopment && !shouldUseReactRefresh
? [
// Include an alternative client for WebpackDevServer. A client's job is to
// connect to WebpackDevServer by a socket and get notified about changes.
// When you save a file, the client will either apply hot updates (in case
// of CSS changes), or refresh the page (in case of JS changes). When you
// make a syntax error, this client will display a syntax error overlay.
// Note: instead of the default WebpackDevServer client, we use a custom one
// to bring better experience for Create React App users. You can replace
// the line below with these two lines if you prefer the stock client:
//
// require.resolve('webpack-dev-server/client') + '?/',
// require.resolve('webpack/hot/dev-server'),
//
// When using the experimental react-refresh integration,
// the webpack plugin takes care of injecting the dev client for us.
webpackDevClientEntry,
// Finally, this is your app's code:
paths.appIndexJs,
// We include the app code last so that if there is a runtime error during
// initialization, it doesn't blow up the WebpackDevServer client, and
// changing JS code would still trigger a refresh.
]
: paths.appIndexJs,
output: {
// The build folder.
path: isEnvProduction ? paths.appBuild : undefined,
Expand Down
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": "24.9.0",
"jest": "25.5.4",
"node-sass": "4.12.0",
"normalize.css": "7.0.0",
"prop-types": "15.7.2",
Expand Down
9 changes: 4 additions & 5 deletions packages/react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@typescript-eslint/eslint-plugin": "^2.10.0",
"@typescript-eslint/parser": "^2.10.0",
"babel-eslint": "10.1.0",
"babel-jest": "^24.9.0",
"babel-jest": "^25.2.6",
"babel-loader": "8.1.0",
"babel-plugin-named-asset-import": "^0.3.6",
"babel-preset-react-app": "^9.1.2",
Expand All @@ -55,10 +55,9 @@
"fs-extra": "^8.1.0",
"html-webpack-plugin": "4.3.0",
"identity-obj-proxy": "3.0.0",
"jest": "24.9.0",
"jest-environment-jsdom-fourteen": "1.0.1",
"jest-resolve": "24.9.0",
"jest-watch-typeahead": "0.4.2",
"jest": "25.5.4",
"jest-resolve": "25.5.1",
"jest-watch-typeahead": "0.5.0",
"mini-css-extract-plugin": "0.9.0",
"optimize-css-assets-webpack-plugin": "5.0.3",
"pnp-webpack-plugin": "1.6.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/scripts/utils/createJestConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = (resolve, rootDir, isEjecting) => {
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}',
],
testEnvironment: 'jest-environment-jsdom-fourteen',
testEnvironment: 'jsdom',
transform: {
'^.+\\.(js|jsx|mjs|cjs|ts|tsx)$': isEjecting
? '<rootDir>/node_modules/babel-jest'
Expand Down