Skip to content

Singleton containers with testcontainers-node? #692

Answered by cristianrgreco
dmurat asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dmurat
Comment options

Answer selected by dmurat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants