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
How do i use jest with create react app #2564
Comments
|
it's configured by default under the hood. no need to install it. BTW, is there any special case you wanna do? |
|
You shouldn't need to change anything to use Jest! If you changed the test script in your package.json, please revert that. |
|
I'll close this, but please let us know if you need more help! |
|
Hi, I created a new app and it works out of the box now. Could not quite figure out why the last one didn't work. Thanks |
|
Maybe you were using |
|
In case someone (like me) only wants to use Jest's
|
|
Btw if you use Yarn 1.0+ you don't need the extra |
|
@pRoy24 I'm having the same problem. Did you solve it? |
|
When I import a component that uses absolute paths the test fails to run with: However when I use a component that does not use absolute paths such as:(https://github.com/facebook/jest/blob/master/examples/snapshot/Link.react.js), the test runs fine. |
|
If anyone is having the same problem as me and pRoy24, I solved it by adding this option
|
|
I have installed jest Error: Cannot find module 'E:\ReactTesting\TestProject\my-app1 - loginappcopy\node_modules\jest-cli' |
|
might be worth removing node_modules/ and re-install using npm install |

Hi, it says in the documentation that create-react-app uses jest. I tried using it directly with npm test and setting jest as my test in package.json, but it says jest isn't recognized. I installed jest and then tried to run the test again, it shows me error on es6 import and export functionalities.
What is the actual way of using jest with create-react-app. Thank you.
The text was updated successfully, but these errors were encountered: