Skip to content
masterclass Buddy

Vitest · Matcher

toMatchTypeOf

toMatchTypeOf checks whether an actual type extends a supplied type. It allows an object to have extra properties, so it is not an exact equality check.

Last updated

Syntax

toMatchTypeOf<T>(expected: T): void

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

Subscribe
  • expectTypeOf
  • toEqualTypeOf
  • toExtend
  • toMatchObjectType

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