I'm using jest
for testing, and in a few test scenarios I get the jest
message:
Jest did not exit one second after the test run has completed.
While taking Jest's recommendation to run with --detectOpenHandles
and ending up with hanging test process that never ends, I saw other online suggestions to add the --forceExit
option as well. Now the test ends and everything is ok.
It worths mentioning that all the tests are running properly and passing, with or without the --detectOpenHandles --forceExit
options.
I wonder if is that considered as best practice in such cases? or is it just serving me as a first aid?
What are the side effects of doing so?
Cheers,