Replies: 1 comment 2 replies
-
Hey @Zomono, Currently this library bootstraps everything before your tests are actually run. If I understood you correctly; you would like to specify which containers to run inside your test files. This would be nice to have but it could complicate the flow of the library because we would need to invent some way of passing information from tests file to the initial bootstrap/setup process. We could of course do this somehow, but it could complicate things unnecessarily. However as an alternative (without complicating library itself), you could make use of the fact that config file is actually a JavaScript file. For example; inside the IMHO implementing some generic way to handle this in this library would be much harder for us. E.g. the system should support TS/JS, it should support configs with docker-compose / plain configurations etc. etc. Let me know what you think! Also thanks for your kind words. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
jest-testcontainers always starts all containers specified in the global jest-testcontainer-config.js file. Most of my tests do not need any container while the other ones only need one or two containers.
If you are running all test together this doesn't matter, but the usual workflow is to run only a single test or a single test suit. This workflow is slowed down by waiting for all containers to finish start up.
So my idea is to tell jest-testcontainers on a test-file basis which containers are reuqired. If no container is required, no one will be started.
This could be done be calling a function with container name as argument eg: useContainer("redis").
However, this library is already awesome. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions