From b8b111e337e75010adf6bc610913f7e2084741bf Mon Sep 17 00:00:00 2001 From: Oleg Gaidarenko Date: Thu, 30 Jul 2015 20:48:26 +0300 Subject: [PATCH] Tests: don't use deprecated argument in test declaration Ref aabe94edb4880c75eeebc5b5b5d66a9ad17008fe --- test/unit/ajax.js | 20 ++++++-- test/unit/attributes.js | 7 ++- test/unit/core.js | 12 +++-- test/unit/css.js | 32 +++++++++--- test/unit/data.js | 24 ++++++--- test/unit/dimensions.js | 8 ++- test/unit/effects.js | 100 ++++++++++++++++++++++++++++---------- test/unit/event.js | 12 +++-- test/unit/manipulation.js | 20 ++++++-- test/unit/queue.js | 4 +- test/unit/wrap.js | 16 ++++-- 11 files changed, 191 insertions(+), 64 deletions(-) diff --git a/test/unit/ajax.js b/test/unit/ajax.js index e934b22b1..a08a3755f 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -20,7 +20,9 @@ module( "ajax", { }); (function() { - test("Unit Testing Environment", 2, function () { + test("Unit Testing Environment", function () { + expect( 2 ); + ok( hasPHP, "Running in an environment with PHP support. The AJAX tests only run if the environment supports PHP!" ); ok( !isLocal, "Unit tests are not ran from file:// (especially in Chrome. If you must test from file:// with Chrome, run it with the --allow-file-access-from-files flag!)" ); }); @@ -1318,7 +1320,9 @@ module( "ajax", { } }); - test( "#7531 - jQuery.ajax() - Location object as url", 1, function () { + test( "#7531 - jQuery.ajax() - Location object as url", function () { + expect( 1 ); + var xhr, success = false; try { @@ -1424,7 +1428,9 @@ module( "ajax", { }); }); - test( "#9887 - jQuery.ajax() - Context with circular references (#9887)", 2, function () { + test( "#9887 - jQuery.ajax() - Context with circular references (#9887)", function () { + expect( 2 ); + var success = false, context = {}; context.field = context; @@ -1720,7 +1726,9 @@ module( "ajax", { //----------- jQuery.domManip() - test( "#11264 - jQuery.domManip() - no side effect because of ajaxSetup or global events", 1, function() { + test( "#11264 - jQuery.domManip() - no side effect because of ajaxSetup or global events", function() { + expect( 1 ); + jQuery.ajaxSetup({ type: "POST" }); @@ -2126,7 +2134,9 @@ module( "ajax", { //----------- jQuery.active - test( "jQuery.active", 1, function() { + test( "jQuery.active", function() { + expect( 1 ); + ok( jQuery.active === 0, "ajax active counter should be zero: " + jQuery.active ); }); diff --git a/test/unit/attributes.js b/test/unit/attributes.js index 43ccaacdf..cb0322834 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -732,7 +732,8 @@ test( "prop('tabindex')", function() { equal( jQuery("#linkWithNoHrefWithNegativeTabIndex").prop("tabindex"), -1, "anchor without href, no tabindex set" ); }); -test( "prop('tabindex', value)", 10, function() { +test( "prop('tabindex', value)", function() { + expect( 10 ); var clone, element = jQuery("#divWithNoTabIndex"); @@ -1450,7 +1451,9 @@ test( "coords returns correct values in IE6/IE7, see #10828", function() { equal( area.attr("coords"), "0,0,0,0", "did not retrieve coords correctly" ); }); -test( "should not throw at $(option).val() (#14686)", 1, function() { +test( "should not throw at $(option).val() (#14686)", function() { + expect( 1 ); + try { jQuery( "