Closed luisfermp19 closed 4 years ago
Hello darksiderlm18,
We register to the globalSetup to start containers defined in the jest-testcontainers-config.js
, so each suite will use the same set of containers.
The caveat is that you can't read global variables defined within globalSetup, in your test suites. Please see here for details.
A common pattern(which this library uses as well) is to write to a file and read it from each test suite. You can see another example here.
Hope this answers your question. Feel free to close the issue if it does.
Regards, Yengas
Hi Yengas,
Thank you very much for the answer, it has finally become clear to me why you store the variables in a file.
Greetings, Best regards! :smile:
Hi everyone!
Thank you very much for this utility!
I have a question that I can't answer no matter how hard I try to dive into the code. Why are global variables written to a
globals.vars.json
file? Couldn't they be directly stored in theglobal
object and then loaded intothis.global
in the environment?Thank you very much for the reply! :smile: Best regards!