jest-matcher-deep-close-to
jest-matcher-deep-close-to copied to clipboard
Be within x percent of?
I'm testing a lot of numbers that are the result of looped calculations and the further the go the more 'off' they will be, but still potentially acceptably.
I was thinking to test these a within percentage of
sort of function would be great and since they're in objects I was happy to find your library. Wondered if you had any interest in extending it in that area..
I'm not sure of an equivalent name of a test to build off of though
That has all the sense, especially taking in mind that the relative error is sometimes more interesting than the absolute one, what is your proposal for the api?
I'm not sure! Trying to think of a term that is short but also distinguishes between absolute and relative approximation. Maybe is relatively close to(target, percecntageDeviation)... Been meaning to look for equivalent APIs in other testing libraries