Skip to content

Latest commit

History

History
19 lines (13 loc) 路 437 Bytes

File metadata and controls

19 lines (13 loc) 路 437 Bytes

vitest/prefer-to-be-truthy

馃摑 Enforce using toBeTruthy.

馃毇 This rule is disabled 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()