Skip to content
masterclass Buddy

Vitest · Method

vi.restoreAllMocks

Restores the original implementations of all spies created with vi.spyOn. It does not clear their call history or reset their mock implementations.

Last updated

Syntax

function restoreAllMocks(): Vitest

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • vi.spyOn
  • vi.clearAllMocks
  • vi.resetAllMocks
  • test.restoreMocks
  • afterEach

Source: Vi | Vitest. Checked 2026-11-03.