mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
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.
This commit is contained in:
parent
54d98835b6
commit
1ec36332fc
@ -1432,7 +1432,9 @@ QUnit.test( "jQuery.parseXML", function( assert ) {
|
|||||||
// Support: IE 11+
|
// Support: IE 11+
|
||||||
// IE throws an error when parsing invalid XML instead of reporting the error
|
// IE throws an error when parsing invalid XML instead of reporting the error
|
||||||
// in a `parsererror` element, skip the test there.
|
// 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 );
|
assert.expect( 2 );
|
||||||
|
|
||||||
var errorArg, lineMatch, line, columnMatch, column;
|
var errorArg, lineMatch, line, columnMatch, column;
|
||||||
@ -1440,7 +1442,7 @@ QUnit.testUnlessIE( "jQuery.parseXML - error reporting", function( assert ) {
|
|||||||
sinon.stub( jQuery, "error" );
|
sinon.stub( jQuery, "error" );
|
||||||
|
|
||||||
jQuery.parseXML( "<p>Not a <<b>well-formed</b> xml string</p>" );
|
jQuery.parseXML( "<p>Not a <<b>well-formed</b> xml string</p>" );
|
||||||
errorArg = jQuery.error.firstCall.lastArg.toLowerCase();
|
errorArg = jQuery.error.firstCall.args[ 0 ].toLowerCase();
|
||||||
console.log( "errorArg", errorArg );
|
console.log( "errorArg", errorArg );
|
||||||
|
|
||||||
lineMatch = errorArg.match( /line\s*(?:number)?\s*(\d+)/ );
|
lineMatch = errorArg.match( /line\s*(?:number)?\s*(\d+)/ );
|
||||||
|
Loading…
Reference in New Issue
Block a user