allow ability for jest to "forceExit"
https://github.com/facebook/jest/issues/1456
jest has the ability to forceexit after a test run. This is for some cases when tests dont clean up nicely after themselves.
There is no way in create-react-app to set this up. React-scripts also does not set this up. We are facing situations where we need forceexit in some cases for our CI and we are unable to wire a CRA project to do this.
We tried using setupTests.js, however since this a cli flag - we are not able to set this up even there.
Any fixes? I am having the same issue
Any update? Love to have this. Looks like we also need to update jest https://github.com/facebook/jest/pull/4105
You can pass CLI flags to jest.
In fact the default generated Jest command already shows how to do it in your package.json.
"test": "react-scripts --env=jsdom --forceExit"
That said if it's not part of Jest 20, this won't work. We have an issue tracking updating Jest, and will do it in a few weeks.