Vitest · Function
expectTypeOf
expectTypeOf provides compile-time assertions for TypeScript types in Vitest. It can compare types directly or inspect properties, function arguments, return values, arrays, promises, and unions.
Last updated
Syntax
expectTypeOf<T>(a?: unknown): ExpectTypeOf
expectTypeOf(a?: unknown).toEqualTypeOf<T>()In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
toEqualTypeOftoExtendtoMatchObjectTypeextractexcludereturnsparametersparameter