Vitest · Matcher
toBeTypeOf
toBeTypeOf checks whether a value has a specified JavaScript type. Use it with expect(value) when a test needs a runtime type assertion.
Last updated
Syntax
expect(value).toBeTypeOf(type)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
expecttoBetoEqualMatchersExpect API Reference