Jest · Matcher
toHaveLength
toHaveLength checks that a value has a length property with a specific numeric value. It is useful for testing array and string sizes.
Last updated
Syntax
expect(value).toHaveLength(number)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
expect(value)not