Skip to content
masterclass Buddy

Vitest · Matcher

toStrictEqual

toStrictEqual compares values recursively and requires matching object types. It also checks explicit undefined properties and whether arrays are sparse.

Last updated

Syntax

expect(received).toStrictEqual(expected)

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

Subscribe
  • toEqual
  • toBe
  • toContainEqual
  • expect
  • not

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