drupal-civicrm/sites/all/modules/civicrm/bower_components/qunit/addons/close-enough
2018-01-14 13:10:16 +00:00
..
close-enough-test.js First commit 2018-01-14 13:10:16 +00:00
close-enough.html First commit 2018-01-14 13:10:16 +00:00
qunit-close-enough.js First commit 2018-01-14 13:10:16 +00:00
README.md First commit 2018-01-14 13:10:16 +00:00

Close-Enough - A QUnit Addon For Number Approximations

This addon for QUnit adds close and notClose assertion methods, to test that numbers are close enough (or different enough) from an expected number, with a specified accuracy.

Usage:

close(actual, expected, maxDifference, message)
notClose(actual, expected, minDifference, message)

Where:

  • maxDifference: the maximum inclusive difference allowed between the actual and expected numbers
  • minDifference: the minimum exclusive difference allowed between the actual and expected numbers
  • actual, expected, message: The usual