aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/ajax.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r--test/unit/ajax.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index 4a93c65fe..c5185efb3 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -2759,4 +2759,18 @@ if ( jQuery.ajax && ( !isLocal || hasPHP ) ) {
start();
});
});
+
+ test( "jQuery.ajax - empty json gets to error callback instead of success callback.", function() {
+ expect( 1 );
+
+ stop();
+
+ jQuery.ajax( url("data/echoData.php"), {
+ error: function( _, __, error ) {
+ equal( typeof error === "object", true, "Didn't get back error object for empty json response" );
+ start();
+ },
+ dataType: "json"
+ });
+ });
}