Skip to content

jest-extended/prefer-to-be-true compatibility with jest/prefer-equality-matcher #226

Open
@geoffswift

Description

@geoffswift

If I have this code:

expect(x === 5).toBe(true);

I may get these violations like so:

Prefer using one of the equality matchers instead  jest/prefer-equality-matcher
Prefer using `toBeTrue()` to test value is `true`  jest-extended/prefer-to-be-true

The "right" solution would be

expect(x).toBe(5);

but the autofix for prefer-to-be-true is changing the code to be like this (and jest/prefer-equality-matcher is unable to spot it)

expect(x === 5).toBe(true);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions