Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
geoffswift opened this issue Jan 16, 2025 · 0 comments

Comments

@geoffswift
Copy link

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant