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
According to the docs mockRestore should restore the original implementation.
I would expect the following test to pass:
import{expect,test,vi}from'vitest';consttestFn=vi.fn(()=>true);test('.mockRestore() should restore initial implementation',()=>{expect(testFn()).toBe(true);testFn.mockReturnValue(false);expect(testFn()).toBe(false);testFn.mockRestore();expect(testFn()).toBe(true);});
I get the following error on stack blitz:
AssertionError: expected undefined to be true // Object.is equality
It seems that instead of restoring the implementation it's wiped completely.
I'd expect that from mockReset not mockRestore.
Describe the bug
According to the docs mockRestore should restore the original implementation.
I would expect the following test to pass:
I get the following error on stack blitz:
It seems that instead of restoring the implementation it's wiped completely.
I'd expect that from mockReset not mockRestore.
Reproduction
StackBlitz Reproduction
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: