Jest · Matcher
toHaveProperty
toHaveProperty checks whether an object has a property at a specified path. It can also check that the property has an expected value.
Last updated
Syntax
expect(received).toHaveProperty(keyPath, value?)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
expectnottoEqualtoMatchObject