aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/qunit-assert-domequal.js
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2023-03-30 09:56:33 +0200
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2023-05-10 10:53:57 +0200
commit546214e86956804a1b02da173a4c6c5ddea11454 (patch)
treea686011bcdbb11a42ed2a2b0c7b7e961b0e22593 /tests/lib/qunit-assert-domequal.js
parentf68d655aff81273d431d5e58bc8af775fc9bd231 (diff)
downloadjquery-ui-546214e86956804a1b02da173a4c6c5ddea11454.tar.gz
jquery-ui-546214e86956804a1b02da173a4c6c5ddea11454.zip
Build: Fork vendors to remove QUnit deprecated API usage
Changes: * add `tests/lib/vendor/**/*` to `.eslintignore` * move `qunit-composite` to `tests/lib` so that we can modify it * move `qunit-assert-classes` to `tests/lib` so that we can modify it * move `qunit-assert-close` to `tests/lib` so that we can modify it * replace `assert.push` with `assert.pushResult` * remove usage of `QUnit.extend` Closes gh-2157
Diffstat (limited to 'tests/lib/qunit-assert-domequal.js')
-rw-r--r--tests/lib/qunit-assert-domequal.js23
1 files changed, 16 insertions, 7 deletions
diff --git a/tests/lib/qunit-assert-domequal.js b/tests/lib/qunit-assert-domequal.js
index bdad9844c..066eb203b 100644
--- a/tests/lib/qunit-assert-domequal.js
+++ b/tests/lib/qunit-assert-domequal.js
@@ -15,11 +15,16 @@ var domEqual = QUnit.assert.domEqual = function( selector, modifier, message ) {
var assert = this;
// Get current state prior to modifier
- var expected = extract( selector, message );
+ var expected = extract( assert, selector, message );
function done() {
- var actual = extract( selector, message );
- assert.push( QUnit.equiv( actual, expected ), actual, expected, message );
+ var actual = extract( assert, selector, message );
+ assert.pushResult( {
+ result: QUnit.equiv( actual, expected ),
+ actual: actual,
+ expected: expected,
+ message: message
+ } );
}
// Run modifier (async or sync), then compare state via done()
@@ -116,11 +121,15 @@ function jQueryVersionSince( version ) {
return compareVersions( $.fn.jquery, version ) >= 0;
}
-function extract( selector, message ) {
+function extract( assert, selector, message ) {
var elem = $( selector );
if ( !elem.length ) {
- QUnit.push( false, null, null,
- "domEqual failed, can't extract " + selector + ", message was: " + message );
+ assert.pushResult( {
+ result: false,
+ actual: null,
+ expected: null,
+ message: "domEqual failed, can't extract " + selector + ", message was: " + message
+ } );
return;
}
@@ -190,7 +199,7 @@ function extract( selector, message ) {
children = elem.children();
if ( children.length ) {
result.children = elem.children().map( function() {
- return extract( $( this ) );
+ return extract( assert, $( this ) );
} ).get();
} else {
result.text = elem.text();