diff options
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/qunit.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/lib/qunit.js b/tests/lib/qunit.js index fc119a47d..5b0be5d23 100644 --- a/tests/lib/qunit.js +++ b/tests/lib/qunit.js @@ -40,6 +40,12 @@ QUnit.reset = ( function( reset ) { }; } )( QUnit.reset ); +// TODO: switch to qunit-assert-close plugin +QUnit.assert.close = function( actual, expected, maxDifference, message ) { + var passes = ( actual === expected ) || Math.abs( actual - expected ) <= maxDifference; + QUnit.push( passes, actual, expected, message ); +}; + return QUnit; } ); |