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