Ensures that value has a .length property equal to expected. Useful for arrays and strings.
.length
expected
Usage
expect('Hello, World').toHaveLength(12);expect([1, 2, 3]).toHaveLength(3); Copy
expect('Hello, World').toHaveLength(12);expect([1, 2, 3]).toHaveLength(3);
Internal options that provide extra context for the matcher.
Received value.
Expected length.
Ensures that value has a
.lengthproperty equal toexpected. Useful for arrays and strings.Usage