Replies: 1 comment 2 replies
-
|
@dai-shi I wonder if this might be a use case that valtio-plugin might be able to help solve pretty easily with it's concept of proxy instances. What do you think? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I couldn't find any section dedicated for resetting states between test cases. I don't mean like manually reseting state in test file or in code base, but providing test configuration similar to what zustand does here.
In my case it's Jest and so far I'm using only proxyMap so I wrote this:
This script just collects all usages of proxyMap and resets them after each test.
You just have to place it in your
project root folder/__mocks__/valtio/utils.tsIs there anything similar done for valtio so far and I've just missed it? I'm asking because valtio seems to be popular enough to have a section for proper test configuration.
Beta Was this translation helpful? Give feedback.
All reactions