Watching tests not working with IntelliJ's Jest Run Configuration
See original GitHub issueWe recently switched from react-scripts v1 to v2. And with that, we now also use craco to rewire some configurations. (Thanks btw. for the awesome package. We used react-app-rewired and the configuration for craco is much nicer and easier to understand!)
Everything works fine so far, except the watch mode of tests in IntelliJ’s Jest Run Configuration does not work properly.
The first run passes without any problem, but as soon as a file changes and a new test run is therefor triggered, the src/setupTests.ts
file is not loaded again. Meaning that enzyme throws an error since no enzyme adapter is configured any more. (Other packages also throw errors since they are not initialized properly)
When I run the test in the regular terminal with the same configuration that I apply in IntelliJ (e.g. yarn run craco test --env=jsdom --watch
), watching works normally and does not throw any errors.
Does anyone know how to fix this? I really do not want to loose the IntelliJ test result reporting since it makes working with tests so much easier.
I’m using react-script@2.1.1 and craco@3.1.1 if that makes any difference.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Just to give you an update on this, it works in the new 2018.3.2 version of IntelliJ, which was released Dec. 19th 2018. 😃
I will close this issue, @Lukas-Kullmann feel free to open it again once you have news from IntelliJ