Jest · Matcher
toBeInstanceOf
.toBeInstanceOf(Class) checks whether a value is an instance of a given class or constructor. It uses JavaScript's instanceof behavior.
Last updated
Syntax
expect(received).toBeInstanceOf(Class)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
expect(value)toBetoBeNulltoBeDefinedtoBeInstanceOf