-
-
Notifications
You must be signed in to change notification settings - Fork 251
Closed
Description
I would like to be able to know if a reusable container is already started before actually "starting" it.
Use case
I need to run some code right after the container has been started, and I could avoid running it once again when the container is being reused.
const container = new GenericContainer().withReuse()...
const startedContainer = container.start()
initializeStuffAfterContainerStart(startedContainer) // useless to run this if the container is already startedProposal
Add a method isStarted() on TestContainer
const container = new GenericContainer().withReuse()...
const isAlreadyStarted = container.isStarted()
const startedContainer = container.start()
if (!isAlreadyStarted) {
initializeStuffAfterContainerStart(startedContainer)
}What do you think? Maybe there is yet another/better solution
I'm willing to work on a PR if needed
Metadata
Metadata
Assignees
Labels
No labels