Skip to content
masterclass Buddy

Vitest · Matcher

toHaveResolved

toHaveResolved checks whether a spy function has successfully resolved at least one promise. It does not pass while the promise is still pending.

Last updated

Syntax

expect(spy).toHaveResolved()

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

Subscribe
  • toHaveResolvedTimes
  • toHaveResolvedWith
  • expect
  • vi.fn

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