Skip to content

Commit 9904075

Browse files
skovhusianschmitz
andauthored
Upgrade to Jest 25 (facebook#8362)
Co-authored-by: Ian Schmitz <ianschmitz@gmail.com>
1 parent 9cc1bdf commit 9904075

File tree

12 files changed

+486
-422
lines changed

12 files changed

+486
-422
lines changed

CHANGELOG-0.x.md

+447-386
Large diffs are not rendered by default.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"get-port": "^4.2.0",
3131
"globby": "^9.1.0",
3232
"husky": "^1.3.1",
33-
"jest": "24.9.0",
33+
"jest": "25.5.4",
3434
"lerna": "3.20.2",
3535
"lerna-changelog": "~0.8.2",
3636
"lint-staged": "^8.0.4",

packages/babel-plugin-named-asset-import/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"devDependencies": {
2222
"babel-plugin-tester": "^8.0.1",
23-
"jest": "24.9.0"
23+
"jest": "25.5.4"
2424
},
2525
"scripts": {
2626
"test": "jest"

packages/babel-preset-react-app/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Make sure you have a `tsconfig.json` file at the root directory. You can also us
5353
```
5454

5555
## Absolute Runtime Paths
56+
5657
Absolute paths are enabled by default for imports. To use relative paths instead, set the `absoluteRuntime` option in `.babelrc` to `false`:
5758

5859
```

packages/confusing-browser-globals/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
"index.js"
2121
],
2222
"devDependencies": {
23-
"jest": "24.9.0"
23+
"jest": "25.5.4"
2424
}
2525
}

packages/cra-template-typescript/template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"@types/node": "^12.0.0",
88
"@types/react": "^16.9.0",
99
"@types/react-dom": "^16.9.0",
10-
"@types/jest": "^24.0.0",
10+
"@types/jest": "^25.0.0",
1111
"typescript": "^3.8.0"
1212
}
1313
}

packages/react-dev-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
},
8080
"devDependencies": {
8181
"cross-env": "^6.0.3",
82-
"jest": "24.9.0"
82+
"jest": "25.5.4"
8383
},
8484
"scripts": {
8585
"test": "cross-env FORCE_COLOR=true jest"

packages/react-error-overlay/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@babel/core": "7.9.6",
3939
"anser": "1.4.9",
4040
"babel-eslint": "10.1.0",
41-
"babel-jest": "^24.9.0",
41+
"babel-jest": "^25.2.6",
4242
"babel-loader": "8.1.0",
4343
"babel-preset-react-app": "^9.1.2",
4444
"chalk": "2.4.2",
@@ -52,7 +52,7 @@
5252
"eslint-plugin-react": "7.19.0",
5353
"flow-bin": "^0.116.0",
5454
"html-entities": "1.3.1",
55-
"jest": "24.9.0",
55+
"jest": "25.5.4",
5656
"jest-fetch-mock": "2.1.2",
5757
"object-assign": "4.1.1",
5858
"promise": "8.1.0",

packages/react-scripts/config/webpack.config.js

+25-22
Original file line numberDiff line numberDiff line change
@@ -157,28 +157,31 @@ module.exports = function(webpackEnv) {
157157
: isEnvDevelopment && 'cheap-module-source-map',
158158
// These are the "entry points" to our application.
159159
// This means they will be the "root" imports that are included in JS bundle.
160-
entry: isEnvDevelopment && !shouldUseReactRefresh ? [
161-
// Include an alternative client for WebpackDevServer. A client's job is to
162-
// connect to WebpackDevServer by a socket and get notified about changes.
163-
// When you save a file, the client will either apply hot updates (in case
164-
// of CSS changes), or refresh the page (in case of JS changes). When you
165-
// make a syntax error, this client will display a syntax error overlay.
166-
// Note: instead of the default WebpackDevServer client, we use a custom one
167-
// to bring better experience for Create React App users. You can replace
168-
// the line below with these two lines if you prefer the stock client:
169-
//
170-
// require.resolve('webpack-dev-server/client') + '?/',
171-
// require.resolve('webpack/hot/dev-server'),
172-
//
173-
// When using the experimental react-refresh integration,
174-
// the webpack plugin takes care of injecting the dev client for us.
175-
webpackDevClientEntry,
176-
// Finally, this is your app's code:
177-
paths.appIndexJs,
178-
// We include the app code last so that if there is a runtime error during
179-
// initialization, it doesn't blow up the WebpackDevServer client, and
180-
// changing JS code would still trigger a refresh.
181-
] : paths.appIndexJs,
160+
entry:
161+
isEnvDevelopment && !shouldUseReactRefresh
162+
? [
163+
// Include an alternative client for WebpackDevServer. A client's job is to
164+
// connect to WebpackDevServer by a socket and get notified about changes.
165+
// When you save a file, the client will either apply hot updates (in case
166+
// of CSS changes), or refresh the page (in case of JS changes). When you
167+
// make a syntax error, this client will display a syntax error overlay.
168+
// Note: instead of the default WebpackDevServer client, we use a custom one
169+
// to bring better experience for Create React App users. You can replace
170+
// the line below with these two lines if you prefer the stock client:
171+
//
172+
// require.resolve('webpack-dev-server/client') + '?/',
173+
// require.resolve('webpack/hot/dev-server'),
174+
//
175+
// When using the experimental react-refresh integration,
176+
// the webpack plugin takes care of injecting the dev client for us.
177+
webpackDevClientEntry,
178+
// Finally, this is your app's code:
179+
paths.appIndexJs,
180+
// We include the app code last so that if there is a runtime error during
181+
// initialization, it doesn't blow up the WebpackDevServer client, and
182+
// changing JS code would still trigger a refresh.
183+
]
184+
: paths.appIndexJs,
182185
output: {
183186
// The build folder.
184187
path: isEnvProduction ? paths.appBuild : undefined,

packages/react-scripts/fixtures/kitchensink/template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"package": {
33
"dependencies": {
44
"bootstrap": "4.3.1",
5-
"jest": "24.9.0",
5+
"jest": "25.5.4",
66
"node-sass": "4.12.0",
77
"normalize.css": "7.0.0",
88
"prop-types": "15.7.2",

packages/react-scripts/package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"@typescript-eslint/eslint-plugin": "^2.10.0",
3535
"@typescript-eslint/parser": "^2.10.0",
3636
"babel-eslint": "10.1.0",
37-
"babel-jest": "^24.9.0",
37+
"babel-jest": "^25.2.6",
3838
"babel-loader": "8.1.0",
3939
"babel-plugin-named-asset-import": "^0.3.6",
4040
"babel-preset-react-app": "^9.1.2",
@@ -55,10 +55,9 @@
5555
"fs-extra": "^8.1.0",
5656
"html-webpack-plugin": "4.3.0",
5757
"identity-obj-proxy": "3.0.0",
58-
"jest": "24.9.0",
59-
"jest-environment-jsdom-fourteen": "1.0.1",
60-
"jest-resolve": "24.9.0",
61-
"jest-watch-typeahead": "0.4.2",
58+
"jest": "25.5.4",
59+
"jest-resolve": "25.5.1",
60+
"jest-watch-typeahead": "0.5.0",
6261
"mini-css-extract-plugin": "0.9.0",
6362
"optimize-css-assets-webpack-plugin": "5.0.3",
6463
"pnp-webpack-plugin": "1.6.4",

packages/react-scripts/scripts/utils/createJestConfig.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = (resolve, rootDir, isEjecting) => {
3838
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
3939
'<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}',
4040
],
41-
testEnvironment: 'jest-environment-jsdom-fourteen',
41+
testEnvironment: 'jsdom',
4242
transform: {
4343
'^.+\\.(js|jsx|mjs|cjs|ts|tsx)$': isEjecting
4444
? '<rootDir>/node_modules/babel-jest'

0 commit comments

Comments
 (0)