@@ -2648,6 +2648,37 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
2648
2648
} ) ;
2649
2649
} ) ;
2650
2650
2651
+ QUnit . test ( "jQuery.get( String, null-ish, null-ish, String ) - dataType with null/undefined data & callback" ,
2652
+ function ( assert ) {
2653
+ assert . expect ( 8 ) ;
2654
+ var done = assert . async ( 8 ) ;
2655
+
2656
+ [
2657
+ { data : null , success : null } ,
2658
+ { data : null , success : undefined } ,
2659
+ { data : undefined , success : null } ,
2660
+ { data : undefined , success : undefined }
2661
+ ] . forEach ( function ( options ) {
2662
+ var data = options . data ,
2663
+ success = options . success ;
2664
+ jQuery . get ( url ( "mock.php?action=json&header" ) , data , success , "json" )
2665
+ . then ( function ( json ) {
2666
+ assert . deepEqual ( json , { data : { lang : "en" , length : 25 } } ,
2667
+ "`dataType: \"json\"` applied with `" + data + "` data & `" +
2668
+ success + "` success callback" ) ;
2669
+ done ( ) ;
2670
+ } ) ;
2671
+
2672
+ jQuery . get ( url ( "mock.php?action=json&header" ) , data , success , "text" )
2673
+ . then ( function ( text ) {
2674
+ assert . strictEqual ( text , "{\"data\":{\"lang\":\"en\",\"length\":25}}" ,
2675
+ "`dataType: \"text\"` applied with `" + data + "` data & `" +
2676
+ success + "` success callback" ) ;
2677
+ done ( ) ;
2678
+ } ) ;
2679
+ } ) ;
2680
+ } ) ;
2681
+
2651
2682
//----------- jQuery.getJSON()
2652
2683
2653
2684
QUnit . test ( "jQuery.getJSON( String, Hash, Function ) - JSON array" , function ( assert ) {
0 commit comments