How to spy the store's $reset method in tests with vitest #2172
Unanswered
meiyerDev
asked this question in
Help and Questions
Replies: 0 comments
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.
-
Suppose we have the following code:
Store declaration
Use of the store
Test declaration
Why the store's $reset method fails in the assertion but the $patch method is successful?
I understand that the $reset method may be using the $patch method to reset the store, but it isn't spied. If we try to use this code
This fails with exception:
TypeError: [Function $reset] is not a spy or a call to a spy!
Beta Was this translation helpful? Give feedback.
All reactions