Skip to content
masterclass Buddy

Vitest · Matcher

toEqual

toEqual checks that two values match. For objects, it compares their structure and values recursively, so separate objects with the same contents can pass.

Last updated

Syntax

expect(actual).toEqual(received)

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

Subscribe
  • toBe
  • toStrictEqual
  • toContainEqual
  • toMatchObject
  • toThrow

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