Jest tests hang & fail after success (exist fine in debug mode + locally)


I have a Node CLI being tested with Travis. The tests all complete successfully however it seems that Jest hangs for eternity until Travis decides it has had enough and fails the build. The tests exit cleanly in debug mode and locally, and I have tried all manner of Jest options, e.g. reduce concurrency, attempt to identify open handles, but to no avail.

Any ideas?

Latest build:


Do you know if the last test/suite printed in your latest build is the last one to be executed? Are your test passing if you comment it out?

Otherwise, are your tests always failing at the same place?

Finally, is there any chance you can run your tests with more logs? For example if the after routine of your tests and/or test suite?

Let me know what you think!