jest
jest copied to clipboard
Add ability to compare "deep" with precision
🚀 Feature Proposal
Add the ability to compare two objects with a precision check. https://github.com/maasencioh/jest-matcher-deep-close-to This extension does the job but lacks a lot of the visibility that jest has when showing diffs. It would also just be cleaner if jest had this built in since this is a conceivably common issue.
Motivation
Often times one will need to compare two objects that contain data. Because of floating point imprecision in Node.js, numbers don't always add up exactly as you expect them to (with ~e-13 points of precision difference). Tests will sometimes need to compare objects for equality but allow for some margin of error.
Example
https://github.com/maasencioh/jest-matcher-deep-close-to does a good job showing this in the README
Bump on this, this would be huge
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.
bump
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.
bump
Bump on this