Skip to content

Commit 63152ef

Browse files
author
Maël Nison
committed
Adds configuration for jest
1 parent f04f0dd commit 63152ef

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/react-scripts/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
"html-webpack-plugin": "4.0.0-alpha.2",
4848
"identity-obj-proxy": "3.0.0",
4949
"jest": "23.6.0",
50+
"jest-pnp-resolver": "^1.0.1",
51+
"jest-resolve": "23.6.0",
5052
"mini-css-extract-plugin": "0.4.3",
5153
"optimize-css-assets-webpack-plugin": "5.0.1",
5254
"pnp-webpack-plugin": "1.0.2",

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ module.exports = (resolve, rootDir, isEjecting) => {
2222
// in Jest configs. We need help from somebody with Windows to determine this.
2323
const config = {
2424
collectCoverageFrom: ['src/**/*.{js,jsx}'],
25-
setupFiles: ['react-app-polyfill/jsdom'],
25+
resolver: require.resolve('jest-pnp-resolver'),
26+
setupFiles: [require.resolve('react-app-polyfill/jsdom')],
2627
setupTestFrameworkScriptFile: setupTestsFile,
2728
testMatch: [
2829
'<rootDir>/src/**/__tests__/**/*.{js,jsx}',

0 commit comments

Comments
 (0)