Skip to content

Commit

Permalink
docs(api): fix the explanation for 'mockRestore'
Browse files Browse the repository at this point in the history
The explanation says "Does what `mockRestore` does", but this should be "Does what `mockReset` does" based on the code.

https://github.com/vitest-dev/vitest/blob/17dfd39e51b33a02458aaab8bf75d42dd680e72b/packages/vitest/src/integrations/spy.ts#L200-L201
  • Loading branch information
kazuma1989 committed Jun 6, 2022
1 parent d6b8591 commit f977262
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api/index.md
Expand Up @@ -1943,7 +1943,7 @@ Vitest provides utility functions to help you out through it's **vi** helper. Yo

- **Type:** `() => MockInstance`

Does what `mockRestore` does and restores inner implementation to the original function.
Does what `mockReset` does and restores inner implementation to the original function.

Note that restoring mock from `vi.fn()` will set implementation to an empty function that returns `undefined`. Restoring a `vi.fn(impl)` will restore implementation to `impl`.

Expand Down

0 comments on commit f977262

Please sign in to comment.