Skip to content

Commit

Permalink
fix(mocker): don't restore mock to the original if module is mocked
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Jun 5, 2023
1 parent 1525389 commit a9dbdc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vitest/src/runtime/mocker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export class VitestMocker {
const mock = spyOn(newContainer, property).mockImplementation(() => undefined)
mock.mockRestore = () => {
mock.mockReset()
mock.mockImplementation(undefined!)
mock.mockImplementation(() => undefined)
return mock
}
// tinyspy retains length, but jest doesn't.
Expand Down

0 comments on commit a9dbdc4

Please sign in to comment.