I recently updated my jest package to the latest version from v24 and on running my unit tests, I am getting this at the end of test suite run:
A worker process has failed to exit gracefully and has been force exited.
This is likely caused by tests leaking due to improper teardown.
Try running with --runInBand --detectOpenHandles to find leaks.
I added --detectOpenHandles with my test command and the messages goes in the next run. I am not sure how to take it as detectOpenHandles is intended for finding the open handles and not fixing it so how is the message not coming in next run and no other message to guide me on what could be the issue.
Has anyone came across similar bhaviour? To add, I am on latest version of jest i.e 27.2.0 now.