diff options
author | Scott González <scott.gonzalez@gmail.com> | 2015-04-17 12:10:36 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2015-04-17 12:10:36 -0400 |
commit | 45797b9b4166a4d2e883cea9712e075bb484e337 (patch) | |
tree | fec8e69fc83d94462643613b3482d7a4ca190e03 /tests/lib/qunit-assert-domequal.js | |
parent | f499569bffae60a6a7161eb2e13ec409afb98450 (diff) | |
download | jquery-ui-45797b9b4166a4d2e883cea9712e075bb484e337.tar.gz jquery-ui-45797b9b4166a4d2e883cea9712e075bb484e337.zip |
Tests: Fix domEqual handling for invalid input
Diffstat (limited to 'tests/lib/qunit-assert-domequal.js')
-rw-r--r-- | tests/lib/qunit-assert-domequal.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/lib/qunit-assert-domequal.js b/tests/lib/qunit-assert-domequal.js index 49c8f6714..ba516453d 100644 --- a/tests/lib/qunit-assert-domequal.js +++ b/tests/lib/qunit-assert-domequal.js @@ -14,10 +14,10 @@ var domEqual = QUnit.assert.domEqual = function( selector, modifier, message ) { var assert = this; // Get current state prior to modifier - var expected = extract( $( selector ) ); + var expected = extract( selector, message ); function done() { - var actual = extract( $( selector ) ); + var actual = extract( selector, message ); assert.push( QUnit.equiv( actual, expected ), actual, expected, message ); } @@ -87,9 +87,10 @@ function getElementStyles( elem ) { return styles; } -function extract( elem ) { - if ( !elem || !elem.length ) { - QUnit.push( false, actual, expected, +function extract( selector, message ) { + var elem = $( selector ); + if ( !elem.length ) { + QUnit.push( false, null, null, "domEqual failed, can't extract " + selector + ", message was: " + message ); return; } |