You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you call vi.restoreAllMocks(); or have restoreMocks set to true this restores functions in modules that are mocked like this vi.mock('./multiply');. to their original implementation.
Describe the bug
When you call
vi.restoreAllMocks();
or haverestoreMocks
set to true this restores functions in modules that are mocked like thisvi.mock('./multiply');
. to their original implementation.That behavior is not documented here https://vitest.dev/guide/mocking.html#automocking-algorithm and is possibly not intended.
This certainly breaks compatibility with jest where restoring all mocks doesn't touch auto-generated modules.
Reproduction
https://stackblitz.com/edit/node-rnge8j?file=mock.test.ts
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: