Skip to content

no restarts in watch mode

Compare
Choose a tag to compare
@Yengas Yengas released this 02 Dec 23:36
· 8 commits to master since this release
c8fb8a4

With this release; jest-testcontainers will not restart containers in watch mode. Meaning you will have one instance of your containers that you will use throughout re-runs of your test. Giving you a huge performance boost 🎉

This release breaks backward compatibility because there maybe integration tests written that expect containers to be restarted. E.g. your tests may modify the database. With the previous versions, these changes would perish when the tests restart because containers would be re-created.

To continue with the old behaviour, you can set JEST_TESTCONTAINERS_RESTART_ON_WATCH env variable to a non-empty string.
Or refactor your tests to clean up after themselves, so re-runs of your tests won't affect eachother.