@@ -2782,7 +2782,7 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
27822782 } ) ;
27832783 } ) ;
27842784
2785- QUnit . test ( "jQuery.get( String, null-ish , String ) - dataType with null callback (gh-4989)" ,
2785+ QUnit . test ( "jQuery.get( String, null, String ) - dataType with null callback (gh-4989)" ,
27862786 function ( assert ) {
27872787 assert . expect ( 2 ) ;
27882788 var done = assert . async ( 2 ) ;
@@ -2802,6 +2802,37 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
28022802 } ) ;
28032803 } ) ;
28042804
2805+ QUnit . test ( "jQuery.get( String, null-ish, null-ish, String ) - dataType with null/undefined data & callback" ,
2806+ function ( assert ) {
2807+ assert . expect ( 8 ) ;
2808+ var done = assert . async ( 8 ) ;
2809+
2810+ [
2811+ { data : null , success : null } ,
2812+ { data : null , success : undefined } ,
2813+ { data : undefined , success : null } ,
2814+ { data : undefined , success : undefined }
2815+ ] . forEach ( function ( options ) {
2816+ var data = options . data ,
2817+ success = options . success ;
2818+ jQuery . get ( url ( "mock.php?action=json&header" ) , data , success , "json" )
2819+ . then ( function ( json ) {
2820+ assert . deepEqual ( json , { data : { lang : "en" , length : 25 } } ,
2821+ "`dataType: \"json\"` applied with `" + data + "` data & `" +
2822+ success + "` success callback" ) ;
2823+ done ( ) ;
2824+ } ) ;
2825+
2826+ jQuery . get ( url ( "mock.php?action=json&header" ) , null , "text" )
2827+ . then ( function ( text ) {
2828+ assert . strictEqual ( text , "{\"data\":{\"lang\":\"en\",\"length\":25}}" ,
2829+ "`dataType: \"text\"` applied with `" + data + "` data & `" +
2830+ success + "` success callback" ) ;
2831+ done ( ) ;
2832+ } ) ;
2833+ } ) ;
2834+ } ) ;
2835+
28052836//----------- jQuery.getJSON()
28062837
28072838 QUnit . test ( "jQuery.getJSON( String, Hash, Function ) - JSON array" , function ( assert ) {
0 commit comments