Skip to content
masterclass Buddy

Vitest · Method

vi.importActual

vi.importActual loads the real version of a module, even when Vitest has mocked it. It is mainly used to create partial mocks.

Last updated

Syntax

function importActual<T>(path: string): Promise<T>

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

Subscribe
  • vi.mock
  • vi.importMock
  • vi.unmock
  • vi.doUnmock
  • vi.hoisted

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