Skip to content
masterclass Buddy

Vitest · Method

vi.unstubAllGlobals

vi.unstubAllGlobals() restores globals changed with vi.stubGlobal(). It also restores related browser globals in jsdom or happy-dom environments.

Last updated

Syntax

function unstubAllGlobals(): Vitest

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

Subscribe
  • vi.stubGlobal
  • unstubGlobals
  • globalThis
  • window

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