-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mocks cannot be reset #1940
Comments
|
@ChpShy yep got that, just wasn't sure on what the workaround is as the PR didn't state one. 🤔 |
Use |
I now see that You can also, instead of directly changing object properties, spy on them, and then call vi.spyOn(data, 'state', 'get').mockReturnValue('STOPPED') |
Describe the bug
Before #1726 I was able to reset my module that I had mocked using
vi.resetModules
in abeforeEach
handler.After updating my tests now fail. Looking at the docs I've tried all of the following with none of them letting me reset the mock to its original mock value.
Reproduction
https://stackblitz.com/edit/node-vzowau?file=test/basic.test.ts
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: