Skip to content

Commit b8b111e

Browse files
committed
Tests: don't use deprecated argument in test declaration
Ref aabe94e
1 parent 6af92ca commit b8b111e

File tree

11 files changed

+191
-64
lines changed

11 files changed

+191
-64
lines changed

test/unit/ajax.js

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

2222
(function() {
23-
test("Unit Testing Environment", 2, function () {
23+
test("Unit Testing Environment", function () {
24+
expect( 2 );
25+
2426
ok( hasPHP, "Running in an environment with PHP support. The AJAX tests only run if the environment supports PHP!" );
2527
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!)" );
2628
});
@@ -1318,7 +1320,9 @@ module( "ajax", {
13181320
}
13191321
});
13201322

1321-
test( "#7531 - jQuery.ajax() - Location object as url", 1, function () {
1323+
test( "#7531 - jQuery.ajax() - Location object as url", function () {
1324+
expect( 1 );
1325+
13221326
var xhr,
13231327
success = false;
13241328
try {
@@ -1424,7 +1428,9 @@ module( "ajax", {
14241428
});
14251429
});
14261430

1427-
test( "#9887 - jQuery.ajax() - Context with circular references (#9887)", 2, function () {
1431+
test( "#9887 - jQuery.ajax() - Context with circular references (#9887)", function () {
1432+
expect( 2 );
1433+
14281434
var success = false,
14291435
context = {};
14301436
context.field = context;
@@ -1720,7 +1726,9 @@ module( "ajax", {
17201726

17211727
//----------- jQuery.domManip()
17221728

1723-
test( "#11264 - jQuery.domManip() - no side effect because of ajaxSetup or global events", 1, function() {
1729+
test( "#11264 - jQuery.domManip() - no side effect because of ajaxSetup or global events", function() {
1730+
expect( 1 );
1731+
17241732
jQuery.ajaxSetup({
17251733
type: "POST"
17261734
});
@@ -2126,7 +2134,9 @@ module( "ajax", {
21262134

21272135
//----------- jQuery.active
21282136

2129-
test( "jQuery.active", 1, function() {
2137+
test( "jQuery.active", function() {
2138+
expect( 1 );
2139+
21302140
ok( jQuery.active === 0, "ajax active counter should be zero: " + jQuery.active );
21312141
});
21322142

test/unit/attributes.js

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

735-
test( "prop('tabindex', value)", 10, function() {
735+
test( "prop('tabindex', value)", function() {
736+
expect( 10 );
736737

737738
var clone,
738739
element = jQuery("#divWithNoTabIndex");
@@ -1450,7 +1451,9 @@ test( "coords returns correct values in IE6/IE7, see #10828", function() {
14501451
equal( area.attr("coords"), "0,0,0,0", "did not retrieve coords correctly" );
14511452
});
14521453

1453-
test( "should not throw at $(option).val() (#14686)", 1, function() {
1454+
test( "should not throw at $(option).val() (#14686)", function() {
1455+
expect( 1 );
1456+
14541457
try {
14551458
jQuery( "<option/>" ).val();
14561459
ok( true );

test/unit/core.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ test( "globalEval", function() {
166166
equal( window.globalEvalTest, 3, "Test context (this) is the window object" );
167167
});
168168

169-
test( "globalEval execution after script injection (#7862)", 1, function() {
169+
test( "globalEval execution after script injection (#7862)", function() {
170+
expect( 1 );
171+
170172
var now,
171173
script = document.createElement( "script" );
172174

@@ -1182,7 +1184,9 @@ test("jQuery.each(Object,Function)", function() {
11821184
equal( i, document.styleSheets.length, "Iteration over document.styleSheets" );
11831185
});
11841186

1185-
test("jQuery.each/map(undefined/null,Function)", 1, function() {
1187+
test("jQuery.each/map(undefined/null,Function)", function() {
1188+
expect( 1 );
1189+
11861190
try {
11871191
jQuery.each( undefined, jQuery.noop );
11881192
jQuery.each( null, jQuery.noop );
@@ -1458,7 +1462,9 @@ test("jQuery.parseJSON", function() {
14581462
strictEqual( jQuery.parseJSON([ 0 ]), 0, "Input cast to string" );
14591463
});
14601464

1461-
test("jQuery.parseXML", 8, function(){
1465+
test("jQuery.parseXML", function(){
1466+
expect( 8 );
1467+
14621468
var xml, tmp;
14631469
try {
14641470
xml = jQuery.parseXML( "<p>A <b>well-formed</b> xml string</p>" );

test/unit/css.js

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ test("css(String|Hash)", function() {
119119
"Make sure that a string z-index is returned from css('z-index') (#14432)." );
120120
});
121121

122-
test( "css(String) computed values", 3, function() {
122+
test( "css(String) computed values", function() {
123+
expect( 3 );
124+
123125
var div = jQuery( "<div/>" ).addClass( "get-computed-value" ),
124126
fixture = document.getElementById( "qunit-fixture" );
125127

@@ -130,7 +132,9 @@ test( "css(String) computed values", 3, function() {
130132
});
131133

132134

133-
test( "css() explicit and relative values", 29, function() {
135+
test( "css() explicit and relative values", function() {
136+
expect( 29 );
137+
134138
var $elem = jQuery("#nothiddendiv");
135139

136140
$elem.css({ "width": 1, "height": 1, "paddingLeft": "1px", "opacity": 1 });
@@ -217,7 +221,9 @@ test( "css() explicit and relative values", 29, function() {
217221
equal( $elem.css("opacity"), "1", "'+=0.5' on opacity (params)" );
218222
});
219223

220-
test( "css() non-px relative values (gh-1711)", 17, function() {
224+
test( "css() non-px relative values (gh-1711)", function() {
225+
expect( 17 );
226+
221227
var cssCurrent,
222228
units = {},
223229
$child = jQuery( "#nothiddendivchild" ),
@@ -962,7 +968,9 @@ test("certain css values of 'normal' should be convertable to a number, see #862
962968

963969
// only run this test in IE9
964970
if ( document.documentMode === 9 ) {
965-
test( ".css('filter') returns a string in IE9, see #12537", 1, function() {
971+
test( ".css('filter') returns a string in IE9, see #12537", function() {
972+
expect( 1 );
973+
966974
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')." );
967975
});
968976
}
@@ -1170,7 +1178,9 @@ asyncTest( "Clearing a Cloned Element's Style Shouldn't Clear the Original Eleme
11701178
window.setTimeout( start, 1000 );
11711179
});
11721180

1173-
test( "show() after hide() should always set display to initial value (#14750)", 1, function() {
1181+
test( "show() after hide() should always set display to initial value (#14750)", function() {
1182+
expect( 1 );
1183+
11741184
var div = jQuery( "<div />" ),
11751185
fixture = jQuery( "#qunit-fixture" );
11761186

@@ -1189,7 +1199,9 @@ test( "show() after hide() should always set display to initial value (#14750)",
11891199
exist = "order" in style || "WebkitOrder" in style;
11901200

11911201
if ( exist ) {
1192-
test( "Don't append px to CSS \"order\" value (#14049)", 1, function() {
1202+
test( "Don't append px to CSS \"order\" value (#14049)", function() {
1203+
expect( 1 );
1204+
11931205
var $elem = jQuery( "<div/>" );
11941206

11951207
$elem.css( "order", 2 );
@@ -1198,7 +1210,9 @@ test( "show() after hide() should always set display to initial value (#14750)",
11981210
}
11991211
})();
12001212

1201-
test( "Do not throw on frame elements from css method (#15098)", 1, function() {
1213+
test( "Do not throw on frame elements from css method (#15098)", function() {
1214+
expect( 1 );
1215+
12021216
var frameWin, frameDoc,
12031217
frameElement = document.createElement( "iframe" ),
12041218
frameWrapDiv = document.createElement( "div" );
@@ -1221,7 +1235,9 @@ test( "Do not throw on frame elements from css method (#15098)", 1, function() {
12211235
}
12221236
});
12231237

1224-
test( "get upper case alpha opacity in IE8", 1, function() {
1238+
test( "get upper case alpha opacity in IE8", function() {
1239+
expect( 1 );
1240+
12251241
var div = document.createElement( "div" ),
12261242
fixture = document.getElementById( "qunit-fixture" );
12271243

test/unit/data.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ function dataTests( elem ) {
7070
equal( jQuery._data(elem, "foo"), "foo2", "(sanity check) jQuery.removeData for user data does not remove internal data" );
7171
}
7272

73-
test("jQuery.data(div)", 25, function() {
73+
test("jQuery.data(div)", function() {
74+
expect( 25 );
75+
7476
var div = document.createElement("div");
7577

7678
dataTests( div );
@@ -81,25 +83,33 @@ test("jQuery.data(div)", 25, function() {
8183
QUnit.expectJqData( this, div, "foo" );
8284
});
8385

84-
test("jQuery.data({})", 25, function() {
86+
test("jQuery.data({})", function() {
87+
expect( 25 );
88+
8589
dataTests( {} );
8690
});
8791

88-
test("jQuery.data(window)", 25, function() {
92+
test("jQuery.data(window)", function() {
93+
expect( 25 );
94+
8995
// remove bound handlers from window object to stop potential false positives caused by fix for #5280 in
9096
// transports/xhr.js
9197
jQuery( window ).off( "unload" );
9298

9399
dataTests( window );
94100
});
95101

96-
test("jQuery.data(document)", 25, function() {
102+
test("jQuery.data(document)", function() {
103+
expect( 25 );
104+
97105
dataTests( document );
98106

99107
QUnit.expectJqData( this, document, "foo" );
100108
});
101109

102-
test("Expando cleanup", 4, function() {
110+
test("Expando cleanup", function() {
111+
expect( 4 );
112+
103113
var div = document.createElement("div");
104114

105115
function assertExpandoAbsent(message) {
@@ -161,7 +171,9 @@ test("jQuery.acceptData", function() {
161171
});
162172

163173
// attempting to access the data of an undefined jQuery element should be undefined
164-
test("jQuery().data() === undefined (#14101)", 2, function() {
174+
test("jQuery().data() === undefined (#14101)", function() {
175+
expect( 2 );
176+
165177
strictEqual(jQuery().data(), undefined);
166178
strictEqual(jQuery().data("key"), undefined);
167179
});

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 );
@@ -475,7 +477,9 @@ testIframe( "dimensions/documentLarge", "window vs. large document", function( j
475477
ok( jQuery( document ).width() > jQuery( window ).width(), "document width is larger than window width" );
476478
});
477479

478-
test( "allow modification of coordinates argument (gh-1848)", 1, function() {
480+
test( "allow modification of coordinates argument (gh-1848)", function() {
481+
expect( 1 );
482+
479483
var offsetTop,
480484
element = jQuery( "<div/>" ).appendTo( "#qunit-fixture" );
481485

0 commit comments

Comments
 (0)