aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2013-01-02 22:55:41 +0100
committerDave Methvin <dave.methvin@gmail.com>2013-01-07 10:34:07 -0500
commit17049c73bc5bf1a41cce4a5b648f55da7bbac533 (patch)
tree78d1b52390e02969cb46403e106df078904f80f0 /test
parentc61150427fc8ccc8e884df8f221a6c9bb5477929 (diff)
downloadjquery-17049c73bc5bf1a41cce4a5b648f55da7bbac533.tar.gz
jquery-17049c73bc5bf1a41cce4a5b648f55da7bbac533.zip
2.0: reduced xhr transport
Diffstat (limited to 'test')
-rw-r--r--test/unit/ajax.js38
1 files changed, 20 insertions, 18 deletions
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 ) {