🔧 This rule is automatically fixable by the
--fix
CLI option.
For expecting a value to be false
, jest-extended
provides the toBeFalse
matcher.
This rule triggers a warning if toBe()
, toEqual()
or toStrictEqual()
is
used to assert against the false
literal.
The following patterns are considered warnings:
expect(true).toBe(false);
expect(wasSuccessful).toEqual(false);
expect(fs.existsSync('/path/to/file')).toStrictEqual(false);
The following patterns are not considered warnings:
expect(true).toBeFalse();
expect(wasSuccessful).toBeFalse();
expect(fs.existsSync('/path/to/file')).toBeFalse();
test('returns false', () => {
expect(areWeThereYet()).toBeFalse();
expect(true).not.toBeFalse();
});