Exposing environments setup function to user #1099
jmcantrell
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm curious about the possibility of exposing access to vitest environments to the user. In particular, it would be nice to have access to the
setup
/teardown
functions so that environments can be isolated per test.My only concern would be if tests are running concurrently, there might be race conditions, but I'm not familiar enough with how concurrency works with vitest to know for certain.
This is the usage I'm hoping for:
I've exposed
environments
in my vitest fork, but the example above doesn't seem to work. I get "TypeError: Cannot read properties of undefined (reading 'jsdom')" even though loggingenvironments
shows it to be an object with the expected environments and their setup functions.Maybe someone with more knowledge of the project can help me understand this or why this might not be a good idea for the user to have access to.
Beta Was this translation helpful? Give feedback.
All reactions