Skip to content

Commit 1ec3633

Browse files
committed
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.
1 parent 54d9883 commit 1ec3633

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/unit/core.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,15 +1432,17 @@ QUnit.test( "jQuery.parseXML", function( assert ) {
14321432
// Support: IE 11+
14331433
// IE throws an error when parsing invalid XML instead of reporting the error
14341434
// in a `parsererror` element, skip the test there.
1435-
QUnit.testUnlessIE( "jQuery.parseXML - error reporting", function( assert ) {
1435+
QUnit[
1436+
document.documentMode ? "skip" : "test"
1437+
]( "jQuery.parseXML - error reporting", function( assert ) {
14361438
assert.expect( 2 );
14371439

14381440
var errorArg, lineMatch, line, columnMatch, column;
14391441

14401442
sinon.stub( jQuery, "error" );
14411443

14421444
jQuery.parseXML( "<p>Not a <<b>well-formed</b> xml string</p>" );
1443-
errorArg = jQuery.error.firstCall.lastArg.toLowerCase();
1445+
errorArg = jQuery.error.firstCall.args[ 0 ].toLowerCase();
14441446
console.log( "errorArg", errorArg );
14451447

14461448
lineMatch = errorArg.match( /line\s*(?:number)?\s*(\d+)/ );

0 commit comments

Comments
 (0)