From 17049c73bc5bf1a41cce4a5b648f55da7bbac533 Mon Sep 17 00:00:00 2001 From: jaubourg Date: Wed, 2 Jan 2013 22:55:41 +0100 Subject: 2.0: reduced xhr transport --- test/unit/ajax.js | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'test') diff --git a/test/unit/ajax.js b/test/unit/ajax.js index c80ac34f7..e3180c5a3 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -1429,24 +1429,26 @@ module( "ajax", { } }); - test( "#11743 - jQuery.ajax() - script, throws exception", 1, function() { - raises(function() { - jQuery.ajax({ - url: "data/badjson.js", - dataType: "script", - throws: true, - // TODO find a way to test this asynchronously, too - async: false, - // Global events get confused by the exception - global: false, - success: function() { - ok( false, "Success." ); - }, - error: function() { - ok( false, "Error." ); - } - }); - }, "exception bubbled" ); + asyncTest( "#11743 - jQuery.ajax() - script, throws exception", 1, function() { + var onerror = window.onerror; + window.onerror = function() { + ok( true, "Exception thrown" ); + window.onerror = onerror; + start(); + }; + jQuery.ajax({ + url: "data/badjson.js", + dataType: "script", + throws: true, + // Global events get confused by the exception + global: false, + success: function() { + ok( false, "Success." ); + }, + error: function() { + ok( false, "Error." ); + } + }); }); jQuery.each( [ "method", "type" ], function( _, globalOption ) { -- cgit v1.2.3