Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
45e62174
Unverified
Commit
45e62174
authored
6 years ago
by
Dan Abramov
Committed by
GitHub
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Fix absolute paths on eject (#5214)
parent
bf5a4bf9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/react-scripts/scripts/utils/createJestConfig.js
+14
-2
packages/react-scripts/scripts/utils/createJestConfig.js
with
14 additions
and
2 deletions
+14
-2
packages/react-scripts/scripts/utils/createJestConfig.js
+
14
-
2
View file @
45e62174
...
...
@@ -22,8 +22,20 @@ module.exports = (resolve, rootDir, isEjecting) => {
// in Jest configs. We need help from somebody with Windows to determine this.
const
config
=
{
collectCoverageFrom
:
[
'
src/**/*.{js,jsx}
'
],
resolver
:
require
.
resolve
(
'
jest-pnp-resolver
'
),
setupFiles
:
[
require
.
resolve
(
'
react-app-polyfill/jsdom
'
)],
// TODO: this breaks Yarn PnP on eject.
// But we can't simply emit this because it'll be an absolute path.
// The proper fix is to write jest.config.js on eject instead of a package.json key.
// Then these can always stay as require.resolve()s.
resolver
:
isEjecting
?
'
jest-pnp-resolver
'
:
require
.
resolve
(
'
jest-pnp-resolver
'
),
setupFiles
:
[
isEjecting
?
'
react-app-polyfill/jsdom
'
:
require
.
resolve
(
'
react-app-polyfill/jsdom
'
),
],
setupTestFrameworkScriptFile
:
setupTestsFile
,
testMatch
:
[
'
<rootDir>/src/**/__tests__/**/*.{js,jsx}
'
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment