📝 Enforce using toBe(true) and toBe(false) over matchers that coerce types to boolean.
all config.
🔧 This rule is automatically fixable by the --fix CLI option.
This rule enforces using toBe(true) and toBe(false), which only match if the value is the corresponding boolean value. This is unlike toBeTruthy(), which matches any truthy value, such as a non-zero number or a non-empty string (which are, conversely, matched by toBeFalsy()).
// bad
expect(foo).toBeTruthy()
expectTypeOf(foo).toBeTruthy()
expect(foo).toBeFalsy()
expectTypeOf(foo).toBeFalsy()
// good
expect(foo).toBe(true)
expectTypeOf(foo).toBe(true)
expect(foo).toBe(false)
expectTypeOf(foo).toBe(false)