Skip to content

Commit 0f5136c

Browse files
committed
Tests: don't use deprecated argument in test declaration
1 parent 5fe76c6 commit 0f5136c

File tree

11 files changed

+196
-65
lines changed

11 files changed

+196
-65
lines changed

test/unit/ajax.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ module( "ajax", {
66
});
77

88
(function() {
9-
test("Unit Testing Environment", 2, function () {
9+
test("Unit Testing Environment", function () {
10+
expect( 2 );
11+
1012
ok( hasPHP, "Running in an environment with PHP support. The AJAX tests only run if the environment supports PHP!" );
1113
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!)" );
1214
});
@@ -1288,7 +1290,9 @@ module( "ajax", {
12881290
}
12891291
});
12901292

1291-
test( "#7531 - jQuery.ajax() - Location object as url", 1, function () {
1293+
test( "#7531 - jQuery.ajax() - Location object as url", function () {
1294+
expect( 1 );
1295+
12921296
var xhr,
12931297
success = false;
12941298
try {
@@ -1389,7 +1393,9 @@ module( "ajax", {
13891393
});
13901394
});
13911395

1392-
test( "#9887 - jQuery.ajax() - Context with circular references (#9887)", 2, function () {
1396+
test( "#9887 - jQuery.ajax() - Context with circular references (#9887)", function () {
1397+
expect( 2 );
1398+
13931399
var success = false,
13941400
context = {};
13951401
context.field = context;
@@ -1699,7 +1705,9 @@ module( "ajax", {
16991705

17001706
//----------- jQuery.domManip()
17011707

1702-
test( "#11264 - jQuery.domManip() - no side effect because of ajaxSetup or global events", 1, function() {
1708+
test( "#11264 - jQuery.domManip() - no side effect because of ajaxSetup or global events", function() {
1709+
expect( 1 );
1710+
17031711
jQuery.ajaxSetup({
17041712
type: "POST"
17051713
});
@@ -2086,7 +2094,9 @@ module( "ajax", {
20862094

20872095
//----------- jQuery.active
20882096

2089-
test( "jQuery.active", 1, function() {
2097+
test( "jQuery.active", function() {
2098+
expect( 1 );
2099+
20902100
ok( jQuery.active === 0, "ajax active counter should be zero: " + jQuery.active );
20912101
});
20922102

test/unit/attributes.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,10 @@ test( "prop('tabindex')", function() {
734734
equal( jQuery("#linkWithNoHrefWithNegativeTabIndex").prop("tabindex"), -1, "anchor without href, no tabindex set" );
735735
});
736736

737-
test( "prop('tabindex', value)", 10, function() {
737+
test( "prop('tabindex', value)", function() {
738+
739+
expect( 10 );
740+
738741

739742
var clone,
740743
element = jQuery("#divWithNoTabIndex");
@@ -1452,7 +1455,9 @@ test( "coords returns correct values in IE6/IE7, see #10828", function() {
14521455
equal( area.attr("coords"), "0,0,0,0", "did not retrieve coords correctly" );
14531456
});
14541457

1455-
test( "should not throw at $(option).val() (#14686)", 1, function() {
1458+
test( "should not throw at $(option).val() (#14686)", function() {
1459+
expect( 1 );
1460+
14561461
try {
14571462
jQuery( "<option/>" ).val();
14581463
ok( true );

test/unit/core.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ test( "globalEval with 'use strict'", function() {
174174
equal( window.strictEvalTest, 1, "Test variable declarations are global (strict mode)" );
175175
});
176176

177-
test( "globalEval execution after script injection (#7862)", 1, function() {
177+
test( "globalEval execution after script injection (#7862)", function() {
178+
expect( 1 );
179+
178180
var now,
179181
script = document.createElement( "script" );
180182

@@ -1198,7 +1200,9 @@ test("jQuery.each(Object,Function)", function() {
11981200
equal( i, document.styleSheets.length, "Iteration over document.styleSheets" );
11991201
});
12001202

1201-
test("jQuery.each/map(undefined/null,Function)", 1, function() {
1203+
test("jQuery.each/map(undefined/null,Function)", function() {
1204+
expect( 1 );
1205+
12021206
try {
12031207
jQuery.each( undefined, jQuery.noop );
12041208
jQuery.each( null, jQuery.noop );
@@ -1477,7 +1481,9 @@ test("jQuery.parseJSON", function() {
14771481
strictEqual( jQuery.parseJSON([ 0 ]), 0, "Input cast to string" );
14781482
});
14791483

1480-
test("jQuery.parseXML", 8, function(){
1484+
test("jQuery.parseXML", function(){
1485+
expect( 8 );
1486+
14811487
var xml, tmp;
14821488
try {
14831489
xml = jQuery.parseXML( "<p>A <b>well-formed</b> xml string</p>" );

test/unit/css.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ test("css(String|Hash)", function() {
116116
"Make sure that a string z-index is returned from css('z-index') (#14432)." );
117117
});
118118

119-
test( "css() explicit and relative values", 29, function() {
119+
test( "css() explicit and relative values", function() {
120+
expect( 29 );
121+
120122
var $elem = jQuery("#nothiddendiv");
121123

122124
$elem.css({ "width": 1, "height": 1, "paddingLeft": "1px", "opacity": 1 });
@@ -203,7 +205,9 @@ test( "css() explicit and relative values", 29, function() {
203205
equal( $elem.css("opacity"), "1", "'+=0.5' on opacity (params)" );
204206
});
205207

206-
test( "css() non-px relative values (gh-1711)", 17, function() {
208+
test( "css() non-px relative values (gh-1711)", function() {
209+
expect( 17 );
210+
207211
var cssCurrent,
208212
units = {},
209213
$child = jQuery( "#nothiddendivchild" ),
@@ -903,7 +907,9 @@ test("certain css values of 'normal' should be convertable to a number, see #862
903907

904908
// only run this test in IE9
905909
if ( document.documentMode === 9 ) {
906-
test( ".css('filter') returns a string in IE9, see #12537", 1, function() {
910+
test( ".css('filter') returns a string in IE9, see #12537", function() {
911+
expect( 1 );
912+
907913
equal( jQuery("<div style='-ms-filter:\"progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFFFFF, endColorstr=#ECECEC)\";'></div>").css("filter"), "progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFFFFF, endColorstr=#ECECEC)", "IE9 returns the correct value from css('filter')." );
908914
});
909915
}
@@ -1111,7 +1117,9 @@ asyncTest( "Clearing a Cloned Element's Style Shouldn't Clear the Original Eleme
11111117
window.setTimeout( start, 1000 );
11121118
});
11131119

1114-
test( "show() after hide() should always set display to initial value (#14750)", 1, function() {
1120+
test( "show() after hide() should always set display to initial value (#14750)", function() {
1121+
expect( 1 );
1122+
11151123
var div = jQuery( "<div />" ),
11161124
fixture = jQuery( "#qunit-fixture" );
11171125

@@ -1130,7 +1138,9 @@ test( "show() after hide() should always set display to initial value (#14750)",
11301138
exist = "order" in style || "WebkitOrder" in style;
11311139

11321140
if ( exist ) {
1133-
test( "Don't append px to CSS \"order\" value (#14049)", 1, function() {
1141+
test( "Don't append px to CSS \"order\" value (#14049)", function() {
1142+
expect( 1 );
1143+
11341144
var $elem = jQuery( "<div/>" );
11351145

11361146
$elem.css( "order", 2 );
@@ -1139,7 +1149,9 @@ test( "show() after hide() should always set display to initial value (#14750)",
11391149
}
11401150
})();
11411151

1142-
test( "Do not throw on frame elements from css method (#15098)", 1, function() {
1152+
test( "Do not throw on frame elements from css method (#15098)", function() {
1153+
expect( 1 );
1154+
11431155
var frameWin, frameDoc,
11441156
frameElement = document.createElement( "iframe" ),
11451157
frameWrapDiv = document.createElement( "div" );

test/unit/data.js

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ function dataTests( elem ) {
126126
equal( jQuery._data(elem, "foo"), "foo2", "(sanity check) jQuery.removeData for user data does not remove internal data" );
127127
}
128128

129-
test("jQuery.data(div)", 25, function() {
129+
test("jQuery.data(div)", function() {
130+
expect( 25 );
131+
130132
var div = document.createElement("div");
131133

132134
dataTests( div );
@@ -137,37 +139,49 @@ test("jQuery.data(div)", 25, function() {
137139
QUnit.expectJqData( this, div, "foo" );
138140
});
139141

140-
test("jQuery.data({})", 25, function() {
142+
test("jQuery.data({})", function() {
143+
expect( 25 );
144+
141145
dataTests( {} );
142146
});
143147

144-
test("jQuery.data(window)", 25, function() {
148+
test("jQuery.data(window)", function() {
149+
expect( 25 );
150+
145151
// remove bound handlers from window object to stop potential false positives caused by fix for #5280 in
146152
// transports/xhr.js
147153
jQuery( window ).off( "unload" );
148154

149155
dataTests( window );
150156
});
151157

152-
test("jQuery.data(document)", 25, function() {
158+
test("jQuery.data(document)", function() {
159+
expect( 25 );
160+
153161
dataTests( document );
154162

155163
QUnit.expectJqData( this, document, "foo" );
156164
});
157165

158-
test("jQuery.data(<embed>)", 25, function() {
166+
test("jQuery.data(<embed>)", function() {
167+
expect( 25 );
168+
159169
dataTests( document.createElement("embed") );
160170
});
161171

162-
test("jQuery.data(object/flash)", 25, function() {
172+
test("jQuery.data(object/flash)", function() {
173+
expect( 25 );
174+
163175
var flash = document.createElement("object");
164176
flash.setAttribute( "classid", "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" );
165177

166178
dataTests( flash );
167179
});
168180

169181
// attempting to access the data of an undefined jQuery element should be undefined
170-
test("jQuery().data() === undefined (#14101)", 2, function() {
182+
test("jQuery().data() === undefined (#14101)", function() {
183+
expect( 2 );
184+
171185
strictEqual(jQuery().data(), undefined);
172186
strictEqual(jQuery().data("key"), undefined);
173187
});
@@ -826,7 +840,9 @@ test("jQuery.acceptData", function() {
826840
"form with aliased DOM properties" );
827841
});
828842

829-
test("Check proper data removal of non-element descendants nodes (#8335)", 1, function() {
843+
test("Check proper data removal of non-element descendants nodes (#8335)", function() {
844+
expect( 1 );
845+
830846
var div = jQuery("<div>text</div>"),
831847
text = div.contents();
832848

test/unit/dimensions.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ test("getting dimensions shouldn't modify runtimeStyle see #9233", function() {
306306
$div.remove();
307307
});
308308

309-
test( "table dimensions", 2, function() {
309+
test( "table dimensions", function() {
310+
expect( 2 );
311+
310312
var table = jQuery("<table><colgroup><col/><col/></colgroup><tbody><tr><td></td><td>a</td></tr><tr><td></td><td>a</td></tr></tbody></table>").appendTo("#qunit-fixture"),
311313
tdElem = table.find("td").first(),
312314
colElem = table.find("col").first().width( 300 );
@@ -460,7 +462,9 @@ testIframe( "dimensions/documentLarge", "window vs. large document", function( j
460462
ok( jQuery( document ).width() > jQuery( window ).width(), "document width is larger than window width" );
461463
});
462464

463-
test( "allow modification of coordinates argument (gh-1848)", 1, function() {
465+
test( "allow modification of coordinates argument (gh-1848)", function() {
466+
expect( 1 );
467+
464468
var offsetTop,
465469
element = jQuery( "<div/>" ).appendTo( "#qunit-fixture" );
466470

0 commit comments

Comments
 (0)