-
-
Notifications
You must be signed in to change notification settings - Fork 493
Babel plugins not applying to Jest #183
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
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@dustinlacewell Hi. I faced the same problem. I use linaria and CracoLinariaPlugin (it includes babel preset) and it works for project build, but not for tests. How did you resolve this problem? |
I have a similar issue with CRACO config not working on tests. CRACO config added to use webpack aliases works fine with #294 seems like a related issue to this. I tried to create a repo to reproduce the error. But CRACO 6.4.3 isn't compatible with CRA 5.0.0. And if I try to use CRA 4.0.3, the CRA installation stops because it says I'm using an old version of CRA. 🤪 I'll try to reproduce the bug once CRACO is compatible with CRA 5.0.0. |
For those who are having issues with aliases on Jest with CRACO, they can work with the below addition on package.json:
{
"name": "my-project",
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "craco eject"
},
"jest": {
"moduleNameMapper": {
"@/(.+)": "<rootDir>/src/$1"
}
}
} Then normally running the tests with |
I have
in my
craco.config.js
and this allows me to properly build my project. However, when I runnpm run test
I get the following error:What do I need to do so that the Babel plugin is used in the context of testing?
The text was updated successfully, but these errors were encountered: