-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Adding asymmetric matcher expect.closeTo
#12242
Labels
Comments
@SimenB what are your thoughts on this? |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
🚀 Feature Proposal
There is a matcher
toBeCloseTo
that's super useful to assert floats. But when these floats are inside objects or arrays we can't use it directly. Therefore it would be useful to have an asymmetric matcher so that we can usetoEqual
with it, eg:It makes sense to be included in Jest core because of the existing matcher toBeCloseTo, that would be more consistent.
Thanks!.
Motivation
t would be useful to have an asymmetric matcher so that we can use
toEqual
with it, eg:Example
it used the same algorith in
toBeCloseTo
Pitch
toBeCloseTo
is super useful to assert floats. but when these floats are inside of any array or object, we can access it directly. and it should belong to jest core platformThe text was updated successfully, but these errors were encountered: