diff options
author | Scott González <scott.gonzalez@gmail.com> | 2015-03-31 16:52:28 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2015-04-09 09:24:45 -0400 |
commit | 2e1c72fb59b3e41da15ebcd83640dbdf13a90d27 (patch) | |
tree | 0a294a24d275202594cd4953843c73f5105677cc /tests/lib | |
parent | 7c896ddb8563e1f4fc655904614cf72d010e2ecb (diff) | |
download | jquery-ui-2e1c72fb59b3e41da15ebcd83640dbdf13a90d27.tar.gz jquery-ui-2e1c72fb59b3e41da15ebcd83640dbdf13a90d27.zip |
Tests: Convert closeEnough() to a proper QUnit assertion
Should eventually replace with qunit-assert-close.
Ref #10119
Ref gh-1528
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; } ); |