aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Gaidarenko <markelog@gmail.com>2014-04-05 18:16:09 +0400
committerOleg Gaidarenko <markelog@gmail.com>2014-04-15 17:46:26 +0400
commit3dc5504237a0fec0d6dcc6d994a9b3950739d579 (patch)
tree7d5e40f9839f6a1577d6b24859486ca45a5ce807
parentd89c278a3363c80d44dd4601bc0cd79c04532529 (diff)
downloadjquery-3dc5504237a0fec0d6dcc6d994a9b3950739d579.tar.gz
jquery-3dc5504237a0fec0d6dcc6d994a9b3950739d579.zip
Tests: Comply the style guide
-rw-r--r--test/data/testrunner.js32
1 files changed, 16 insertions, 16 deletions
diff --git a/test/data/testrunner.js b/test/data/testrunner.js
index e5ee2f980..092cd0e34 100644
--- a/test/data/testrunner.js
+++ b/test/data/testrunner.js
@@ -25,7 +25,7 @@ QUnit.config.requireExpects = true;
* QUnit hooks
*/
-function keys(o) {
+function keys( o ) {
var ret, key;
if ( Object.keys ) {
ret = Object.keys( o );
@@ -59,7 +59,7 @@ QUnit.expectJqData = function( elems, key ) {
}
for ( i = 0; i < elems.length; i++ ) {
- elem = elems[i];
+ elem = elems[ i ];
// jQuery.data only stores data for nodes in jQuery.cache,
// for other data targets the data is stored in the object itself,
@@ -83,10 +83,10 @@ QUnit.expectJqData = function( elems, key ) {
// (instead of in teardown).
notStrictEqual( expando, undefined, "Target for expectJqData must have an expando, for else there can be no data to expect." );
} else {
- if ( expectedDataKeys[expando] ) {
- expectedDataKeys[expando].push( key );
+ if ( expectedDataKeys[ expando ] ) {
+ expectedDataKeys[ expando ].push( key );
} else {
- expectedDataKeys[expando] = [ key ];
+ expectedDataKeys[ expando ] = [ key ];
}
}
}
@@ -112,18 +112,18 @@ window.moduleTeardown = function() {
// provided some information to compare against.
if ( QUnit.urlParams.jqdata || this.checkJqData ) {
for ( i in jQuery.cache ) {
- expectedKeys = expectedDataKeys[i];
- actualKeys = jQuery.cache[i] ? keys( jQuery.cache[i] ) : jQuery.cache[i];
+ expectedKeys = expectedDataKeys[ i ];
+ actualKeys = jQuery.cache[ i ] ? keys( jQuery.cache[ i ] ) : jQuery.cache[ i ];
if ( !QUnit.equiv( expectedKeys, actualKeys ) ) {
deepEqual( actualKeys, expectedKeys, "Expected keys exist in jQuery.cache" );
}
- delete jQuery.cache[i];
- delete expectedDataKeys[i];
+ delete jQuery.cache[ i ];
+ delete expectedDataKeys[ i ];
}
// In case it was removed from cache before (or never there in the first place)
for ( i in expectedDataKeys ) {
- deepEqual( expectedDataKeys[i], undefined, "No unexpected keys were left in jQuery.cache (#" + i + ")" );
- delete expectedDataKeys[i];
+ deepEqual( expectedDataKeys[ i ], undefined, "No unexpected keys were left in jQuery.cache (#" + i + " )" );
+ delete expectedDataKeys[ i ];
}
}
@@ -139,7 +139,7 @@ window.moduleTeardown = function() {
if ( jQuery.active !== undefined && jQuery.active !== oldActive ) {
equal( jQuery.active, oldActive, "No AJAX requests are still active" );
if ( ajaxTest.abort ) {
- ajaxTest.abort("active requests");
+ ajaxTest.abort( "active requests" );
}
oldActive = jQuery.active;
}
@@ -160,16 +160,16 @@ window.moduleTeardown = function() {
QUnit.done(function() {
// Remove our own fixtures outside #qunit-fixture
- supportjQuery("#qunit ~ *").remove();
+ supportjQuery( "#qunit ~ *" ).remove();
});
// jQuery-specific post-test cleanup
reset = function() {
// Ensure jQuery events and data on the fixture are properly removed
- jQuery("#qunit-fixture").empty();
+ jQuery( "#qunit-fixture" ).empty();
// ...even if the jQuery under test has a broken .empty()
- supportjQuery("#qunit-fixture").empty();
+ supportjQuery( "#qunit-fixture" ).empty();
// Reset internal jQuery state
jQuery.event.global = {};
@@ -183,7 +183,7 @@ reset = function() {
Globals.cleanup();
};
-QUnit.testDone(reset);
+QUnit.testDone( reset );
// Register globals for cleanup and the cleanup code itself
// Explanation at http://perfectionkills.com/understanding-delete/#ie_bugs