Skip to content
masterclass Buddy

Vitest · Method

vi.waitUntil

vi.waitUntil polls a callback until it returns a truthy value. It fails immediately when the callback throws and resolves with the successful value.

Last updated

Syntax

function waitUntil<T>(callback: WaitUntilCallback<T>, options?: number | WaitUntilOptions): Promise<T>

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

Subscribe
  • vi.waitFor
  • expect.poll
  • vi.useFakeTimers
  • page.locator
  • expect.element

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