QUnit Close assertion plugin
This plugin for QUnit adds
assertion methods to test that a number is approximately equal (or not) to an expected number, within a given tolerance.
assert;assert;assertclose;// Alternatively:assert;assertnotClose;// Alternatively:assert;
maxDifference: the maximum inclusive difference allowed (tolerance) between the
minDifference: the minimum exclusive difference allowed (tolerance) between the
message: The usual
Example 1: Number differences
Example 2: Percentage differences
For more examples, refer to the unit tests.