I\'m using JEST for unit testing my express routes.
While running the yarn test all my test case are getting passed, but I\'m getting an error
yarn test
For me it was a different issue I was using supertest to test routes itself so I had to close the connection to the server itself.
afterAll(done => { server.close(); done(); });
If this is not the case for you this issue might have something for you