Skip to content
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

[new rule] prefer-to-comparison #989

Closed
sapphi-red opened this issue Nov 24, 2021 · 3 comments · Fixed by #1015
Closed

[new rule] prefer-to-comparison #989

sapphi-red opened this issue Nov 24, 2021 · 3 comments · Fixed by #1015
Labels

Comments

@sapphi-red
Copy link

Prefer expect(a).toBeGreaterThan(b) rather than expect(a > b).toBe(true), which has a better error message.

Also the same with:

  • expect(a).toBeGreaterThanOrEqual(b)
  • expect(a).toBeLessThan(b)
  • expect(a).toBeLessThanOrEqual(b)
@G-Rath
Copy link
Collaborator

G-Rath commented Dec 19, 2021

Should this be a new rule, or part of prefer-to-be 🤔

@sapphi-red
Copy link
Author

sapphi-red commented Dec 19, 2021

I felt this is simillar to prefer-to-contain, so I thought this should be a new rule.

@github-actions
Copy link

🎉 This issue has been resolved in version 25.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants