testjavascript / nodejs-integration-tests-best-practices

✅ Beyond the basics of Node.js testing. Including a super-comprehensive best practices list and an example app (March 2024)
3.31k stars 196 forks source link

Close sequalize connection in stopWebServer #136

Open mikicho opened 3 years ago

mikicho commented 3 years ago

We get:

Force exiting Jest: Have you considered using `--detectOpenHandles` to detect async operations that kept running after all tests finished?

Probably because we don't close the connection to the DB. It may require using only one instance of sequalize.

rubengmurray commented 2 years ago

Seeing something similar when I run locally

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 --detectOpenHandles to find leaks.