Replies: 2 comments 4 replies
-
Did you find a way to achieve this? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Sounds exactly like a use-case for globalSetup. Does that work for you? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I was wondering if it's possible to do a global setup for integration tests ONCE only. I've struggled to do this with Jest, as it seems super unreliable to do so.
What I would like to achieve:
Separate unit and integration tests (already done so by giving it a different file name pattern), run the unit tests just as they come, but for the integration tests, run the setup (starting in-memory Mongo, Redis, ...) only once and share the setup and eventually have a global teardown method taking care of the teardown afterwards.
In jest, this is supposed to be possible with testEnvironments, but they never worked for me, so I was wondering whether Vitest supports a similar approach that would enable a one-time setup/teardown (not per file, but for the entire test suite).
Beta Was this translation helpful? Give feedback.
All reactions