Skip to content
masterclass Buddy

Vitest · Matcher

toEqualTypeOf

toEqualTypeOf checks that a tested TypeScript type is fully equal to an expected type. It checks type shape, not runtime object values.

Last updated

Syntax

expectTypeOf(value).toEqualTypeOf<T>()
expectTypeOf(value).toEqualTypeOf(expected)

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

Subscribe
  • expectTypeOf
  • toExtend
  • toMatchTypeOf
  • assertType

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