Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 430 Bytes

prefer-to-be-truthy.md

File metadata and controls

17 lines (12 loc) · 430 Bytes

Enforce using toBeTruthy (vitest/prefer-to-be-truthy)

⚠️ This rule warns in the 🌐 all config.

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

// bad
expect(foo).toBe(true)
expectTypeOf(foo).toBe(true)

// good
expect(foo).toBeTruthy()
expectTypeOf(foo).toBeTruthy()