Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 394 Bytes

prefer-to-have-length.md

File metadata and controls

14 lines (10 loc) · 394 Bytes

Enforce using toHaveLength() (vitest/prefer-to-have-length)

⚠️ This rule warns in the 🌐 all config.

🔧 This rule is automatically fixable by the --fix CLI option.

// bad
expect(files.length).toStrictEqual(1);

// good
expect(files).toHaveLength(1);