Why doesn't Jest complete the async operation(s) in this Node test?
To forcefully close Jest rather than DB Connection :
--forceExit
So my test script looked something like this,
"scripts": {
"test": "jest --forceExit"
}
You need to call knex.destroy()
in the end of the test suite to teardown connection pool.