Singleton containers with testcontainers-node? #692
-
With testcontainers-node, is it possible to use singleton containers (like described in https://java.testcontainers.org/test_framework_integration/manual_lifecycle_control/#singleton-containers) and expect containers to be cleaned up automatically by ryuk? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @dmurat, implementing a singleton is more a language design pattern rather than a Testcontainers concern. If for example you are using Jest as your test framework, you could implement a global setup script which starts a container and makes it accessible to your tests, and a global teardown script which stops the container. |
Beta Was this translation helpful? Give feedback.
Hi @dmurat, implementing a singleton is more a language design pattern rather than a Testcontainers concern.
If for example you are using Jest as your test framework, you could implement a global setup script which starts a container and makes it accessible to your tests, and a global teardown script which stops the container.