-
Notifications
You must be signed in to change notification settings - Fork 106
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
Unable to run Jest tests when running under create-react-app #34
Comments
you need to provide correct transformer to jest, see https://jestjs.io/docs/en/getting-started#using-babel |
It's a bit of a pain to edit the babel settings in a CRA based project without ejecting it. Any hints on what are the correct transformers to make it work in a CRA TypeScript project? Or why this error is thrown during testing, but not when compiling? |
@lepinkainen if you will create reproduction repo I could take a look. As I understand you can override options |
transformIgnorePatterns did not work for me. Had to use: |
@alicialics Can you share the stub file you used? |
@lepinkainen here's what I used: package.json:
stub.js:
|
When trying to run Jest tests under create react app with
yarn test
I get the following error:The code compiles just fine without any errors and works as intended. Somehow running it with NODE_ENV=test causes the transpiler to fail.
The text was updated successfully, but these errors were encountered: