From aabe94edb4880c75eeebc5b5b5d66a9ad17008fe Mon Sep 17 00:00:00 2001 From: Oleg Gaidarenko Date: Wed, 29 Jul 2015 18:10:04 +0300 Subject: [PATCH] Tests: don't use deprecated argument in test declaration Closes gh-2507 --- test/unit/ajax.js | 20 ++++++-- test/unit/attributes.js | 7 ++- test/unit/core.js | 12 +++-- test/unit/css.js | 24 +++++++--- test/unit/data.js | 32 +++++++++---- test/unit/dimensions.js | 8 +++- test/unit/effects.js | 99 +++++++++++++++++++++++++++++---------- test/unit/event.js | 12 +++-- test/unit/manipulation.js | 28 ++++++++--- test/unit/queue.js | 8 +++- test/unit/wrap.js | 8 +++- 11 files changed, 193 insertions(+), 65 deletions(-) diff --git a/test/unit/ajax.js b/test/unit/ajax.js index e216f34a2..6eedc5784 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -6,7 +6,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!)" ); }); @@ -1288,7 +1290,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 { @@ -1389,7 +1393,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; @@ -1699,7 +1705,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" }); @@ -2086,7 +2094,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 526cfc99d..cec7b6055 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -734,7 +734,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"); @@ -1452,7 +1453,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( "