[Test Related] globalSetup is Not Working in the Configuration #13700
Unanswered
Sahil-Maiyani
asked this question in
Q&A
Replies: 1 comment
-
@gaearon I know it's very old issue since you raised your PR in 2018. Just tagging here in case you might have any recent idea. thanks. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My Version: "react-scripts": "^5.0.1",
I am configuring my project for testing. I have add globalSetup flag under the jest in the package.json
After doing this when I run test with npm test which is eventually run
react-scripts test
facing below error:Error Details (Please expand it)
react-scripts test
Out of the box, Create React App only supports overriding these Jest options:
• clearMocks
• collectCoverageFrom
• coveragePathIgnorePatterns
• coverageReporters
• coverageThreshold
• displayName
• extraGlobals
• globalSetup
• globalTeardown
• moduleNameMapper
• resetMocks
• resetModules
• restoreMocks
• snapshotSerializers
• testMatch
• transform
• transformIgnorePatterns
• watchPathIgnorePatterns.
These options in your package.json Jest configuration are not currently supported by Create React App:
• globalSetup
If you wish to override other Jest options, you need to eject from the default setup. You can do so by running npm run eject but remember that this is a one-way operation. You may also file an issue with Create React App to discuss supporting more options out of the box.
As per my research it has been fixed with: https://github.com/facebook/create-react-app/pull/5218/commits
Some other links for additional information I found while searching.
#4393
https://jestjs.io/docs/configuration#globalsetup-string
Is this a bug or am I doing anything wrong?
Please help me here. Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions