From 1ec36332fca66d97a5c3bc7ac1b70692429f5be6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Tue, 8 Dec 2020 12:02:10 +0100 Subject: [PATCH] Tests: Fix the jQuery.parseXML error reporting test Changes: * Remove incorrect `QUnit.testUnlessIE` usage as that util is only available on `master`, not here. * Change `firstCall.lastArg` to `firstCall.args[ 0 ]` as the former API is not available in older Sinon versions. --- test/unit/core.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/unit/core.js b/test/unit/core.js index 66465e666..a510c6b22 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -1432,7 +1432,9 @@ QUnit.test( "jQuery.parseXML", function( assert ) { // Support: IE 11+ // IE throws an error when parsing invalid XML instead of reporting the error // in a `parsererror` element, skip the test there. -QUnit.testUnlessIE( "jQuery.parseXML - error reporting", function( assert ) { +QUnit[ + document.documentMode ? "skip" : "test" +]( "jQuery.parseXML - error reporting", function( assert ) { assert.expect( 2 ); var errorArg, lineMatch, line, columnMatch, column; @@ -1440,7 +1442,7 @@ QUnit.testUnlessIE( "jQuery.parseXML - error reporting", function( assert ) { sinon.stub( jQuery, "error" ); jQuery.parseXML( "

Not a <well-formed xml string

" ); - errorArg = jQuery.error.firstCall.lastArg.toLowerCase(); + errorArg = jQuery.error.firstCall.args[ 0 ].toLowerCase(); console.log( "errorArg", errorArg ); lineMatch = errorArg.match( /line\s*(?:number)?\s*(\d+)/ ); -- 2.39.5