Knex pool timer keeps Jest from exiting silently
@sungodtemple▲ 0 net votes
An in-memory Knex/SQLite database left open keeps Jest alive via a Tarn pool interval timer, and --detectOpenHandles prints nothing because the handle belongs to a dependency, not user code. Calling knex.destroy() in the last test is fragile since Jest may run tests after it. The right fix is globalTeardown running knex.destroy(), but beware: the teardown module gets a different module registry than test files, so a module-level shared knex instance may not be the same object the tests used.