diff options
author | Scott González <scott.gonzalez@gmail.com> | 2015-04-08 09:15:23 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2015-04-09 09:28:25 -0400 |
commit | 4bf80d209a7e804e1aa33d92faf3812a714a03c2 (patch) | |
tree | 928a94f9342bb92ec79d1a8fb8c4a07be88ec53f /tests/lib | |
parent | bde431bb449b1d957d4e0b736111ff342f2a919d (diff) | |
download | jquery-ui-4bf80d209a7e804e1aa33d92faf3812a714a03c2.tar.gz jquery-ui-4bf80d209a7e804e1aa33d92faf3812a714a03c2.zip |
Tests: Use the qunit-assert-close module
Moved QUnit assertion dependencies from `lib/bootstrap` to `lib/qunit`.
Corrected bad draggable assertions.
Ref gh-1528
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/bootstrap.js | 10 | ||||
-rw-r--r-- | tests/lib/qunit.js | 9 |
2 files changed, 8 insertions, 11 deletions
diff --git a/tests/lib/bootstrap.js b/tests/lib/bootstrap.js index 6d608f2eb..7ca1bbda7 100644 --- a/tests/lib/bootstrap.js +++ b/tests/lib/bootstrap.js @@ -10,13 +10,15 @@ window.requirejs = { "lib": "../../lib", "phantom-bridge": "../../../node_modules/grunt-contrib-qunit/phantomjs/bridge", "qunit-assert-classes": "../../../external/qunit-assert-classes/qunit-assert-classes", + "qunit-assert-close": "../../../external/qunit-assert-close/qunit-assert-close", "qunit": "../../../external/qunit/qunit", "ui": "../../../ui" }, shim: { "globalize/ja-JP": [ "globalize" ], "jquery-simulate": [ "jquery" ], - "qunit-assert-classes": [ "qunit" ] + "qunit-assert-classes": [ "qunit" ], + "qunit-assert-close": [ "qunit" ] } }; @@ -43,11 +45,9 @@ function requireModules( dependencies, callback, modules ) { // Load a set of test file along with the required test infrastructure function requireTests( dependencies, noBackCompat ) { dependencies = [ - "../../lib/qunit", + "lib/qunit", noBackCompat ? "jquery-no-back-compat" : "jquery", - "jquery-simulate", - "qunit-assert-classes", - "../../lib/qunit-assert-domequal" + "jquery-simulate" ].concat( dependencies ); requireModules( dependencies, function( QUnit ) { diff --git a/tests/lib/qunit.js b/tests/lib/qunit.js index 5b0be5d23..757b6a501 100644 --- a/tests/lib/qunit.js +++ b/tests/lib/qunit.js @@ -1,6 +1,9 @@ define( [ "qunit", "jquery", + "qunit-assert-classes", + "qunit-assert-close", + "lib/qunit-assert-domequal", "phantom-bridge" ], function( QUnit, $ ) { @@ -40,12 +43,6 @@ 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; } ); |