aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/ajax.js
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2020-01-27 18:54:47 +0100
committerGitHub <noreply@github.com>2020-01-27 18:54:47 +0100
commitd525ae3416417186330bb3d14133df84509803a0 (patch)
tree7f6920f6228a5d8934f539abba28f8f8ed756191 /test/unit/ajax.js
parent7a3cf9c03cc34d5493383852f94d96fe4a3486ef (diff)
downloadjquery-d525ae3416417186330bb3d14133df84509803a0.tar.gz
jquery-d525ae3416417186330bb3d14133df84509803a0.zip
Build:Tests: Fix custom build tests, verify on Travis; name Travis jobs
This commit fixes unit tests for the following builds: 1. The no-deprecated build: `custom:-deprecated` 2. The current slim build: `custom:-ajax,-effects` 3. The 4.0 (#4553) slim build: `custom:-ajax,-callbacks,-deferred,-effects` It also adds separate Travis jobs for the no-deprecated & slim builds. Apart from that, add intuitive names to Travis jobs. Otherwise it's hard to see at a glance that a particular job is running on Firefox ESR, for example. Ref gh-4577 Ref gh-4596 Closes gh-4600
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r--test/unit/ajax.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index fda7a9daf..bcf7202cd 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -257,7 +257,7 @@ QUnit.module( "ajax", {
ajaxTest( "jQuery.ajax() - headers", 8, function( assert ) {
return {
setup: function() {
- jQuery( document ).ajaxSend( function( evt, xhr ) {
+ jQuery( document ).on( "ajaxSend", function( evt, xhr ) {
xhr.setRequestHeader( "ajax-send", "test" );
} );
},
@@ -611,10 +611,10 @@ QUnit.module( "ajax", {
return {
setup: function() {
jQuery( context ).appendTo( "#foo" )
- .ajaxSend( event )
- .ajaxComplete( event )
- .ajaxError( event )
- .ajaxSuccess( event );
+ .on( "ajaxSend", event )
+ .on( "ajaxComplete", event )
+ .on( "ajaxError", event )
+ .on( "ajaxSuccess", event );
},
requests: [ {
url: url( "name.html" ),
@@ -2455,7 +2455,7 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
var done = assert.async();
addGlobalEvents( "ajaxStart ajaxStop ajaxSend ajaxComplete ajaxError", assert )();
- jQuery( document ).ajaxStop( done );
+ jQuery( document ).on( "ajaxStop", done );
jQuery( "<div/>" ).load( baseURL + "404.txt", function() {
assert.ok( true, "complete" );
} );
@@ -2643,7 +2643,7 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
jQuery.ajaxSetup( {
dataType: "json"
} );
- jQuery( document ).ajaxComplete( function( e, xml, s ) {
+ jQuery( document ).on( "ajaxComplete", function( e, xml, s ) {
assert.strictEqual( s.dataType, "html", "Verify the load() dataType was html" );
jQuery( document ).off( "ajaxComplete" );
done();
@@ -2664,7 +2664,7 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
}
} );
jQuery( "#foo" ).load( baseURL + "mock.php?action=echoQuery", data );
- jQuery( document ).ajaxComplete( function( event, jqXHR, options ) {
+ jQuery( document ).on( "ajaxComplete", function( event, jqXHR, options ) {
assert.ok( ~options.data.indexOf( "foo=bar" ), "Data from ajaxSettings was used" );
done();
} );