mirror of
https://github.com/jquery/jquery.git
synced 2026-02-01 19:15:02 -05:00
Build: update grunt-jscs-checker and pass with the new rules
Conflicts: build/tasks/build.js src/ajax/xhr.js src/attributes/classes.js src/attributes/prop.js src/attributes/val.js src/core/init.js src/core/ready.js src/css.js src/css/curCSS.js src/css/defaultDisplay.js src/data.js src/data/var/dataPriv.js src/data/var/dataUser.js src/dimensions.js src/effects.js src/event.js src/manipulation.js src/offset.js src/queue.js src/selector-native.js test/data/testrunner.js
This commit is contained in:
@@ -224,7 +224,8 @@ this.testIframe = function( fileName, name, fn ) {
|
||||
function loadFixture() {
|
||||
var src = url( "./data/" + fileName + ".html" ),
|
||||
iframe = jQuery( "<iframe />" ).appendTo( "body" )[ 0 ];
|
||||
iframe.style.cssText = "width: 500px; height: 500px; position: absolute; top: -600px; left: -600px; visibility: hidden;";
|
||||
iframe.style.cssText = "width: 500px; height: 500px; position: absolute; " +
|
||||
"top: -600px; left: -600px; visibility: hidden;";
|
||||
|
||||
iframe.contentWindow.location = src;
|
||||
return iframe;
|
||||
@@ -307,7 +308,8 @@ this.loadTests = function() {
|
||||
|
||||
// Load the TestSwarm listener if swarmURL is in the address.
|
||||
if ( loadSwarm ) {
|
||||
require( [ "http://swarm.jquery.org/js/inject.js?" + (new Date()).getTime() ], function() {
|
||||
require( [ "http://swarm.jquery.org/js/inject.js?" + (new Date()).getTime() ],
|
||||
function() {
|
||||
QUnit.start();
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -44,12 +44,13 @@ function keys( o ) {
|
||||
* @param {string} key
|
||||
*/
|
||||
QUnit.expectJqData = function( elems, key ) {
|
||||
var i, elem, expando;
|
||||
var i, elem, expando,
|
||||
currentEnv = "current_testEnvironment";
|
||||
|
||||
// As of jQuery 2.0, there will be no "cache"-data is
|
||||
// stored and managed completely below the API surface
|
||||
if ( jQuery.cache ) {
|
||||
QUnit.current_testEnvironment.checkJqData = true;
|
||||
QUnit[ currentEnv ].checkJqData = true;
|
||||
|
||||
if ( elems.jquery && elems.toArray ) {
|
||||
elems = elems.toArray();
|
||||
@@ -81,7 +82,12 @@ QUnit.expectJqData = function( elems, key ) {
|
||||
// Since this method was called it means some data was
|
||||
// expected to be found, but since there is nothing, fail early
|
||||
// (instead of in teardown).
|
||||
notStrictEqual( expando, undefined, "Target for expectJqData must have an expando, for else there can be no data to expect." );
|
||||
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 );
|
||||
@@ -96,7 +102,8 @@ QUnit.expectJqData = function( elems, key ) {
|
||||
QUnit.config.urlConfig.push({
|
||||
id: "jqdata",
|
||||
label: "Always check jQuery.data",
|
||||
tooltip: "Trigger QUnit.expectJqData detection for all tests instead of just the ones that call it"
|
||||
tooltip: "Trigger QUnit.expectJqData detection for all tests " +
|
||||
"instead of just the ones that call it"
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -122,7 +129,11 @@ window.moduleTeardown = function() {
|
||||
}
|
||||
// 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 + " )" );
|
||||
deepEqual(
|
||||
expectedDataKeys[ i ],
|
||||
undefined,
|
||||
"No unexpected keys were left in jQuery.cache (#" + i + ")"
|
||||
);
|
||||
delete expectedDataKeys[ i ];
|
||||
}
|
||||
}
|
||||
@@ -150,8 +161,10 @@ window.moduleTeardown = function() {
|
||||
++cacheLength;
|
||||
}
|
||||
|
||||
// Because QUnit doesn't have a mechanism for retrieving the number of expected assertions for a test,
|
||||
// if we unconditionally assert any of these, the test will fail with too many assertions :|
|
||||
// Because QUnit doesn't have a mechanism for retrieving
|
||||
// the number of expected assertions for a test,
|
||||
// if we unconditionally assert any of these,
|
||||
// the test will fail with too many assertions :|
|
||||
if ( cacheLength !== oldCacheLength ) {
|
||||
equal( cacheLength, oldCacheLength, "No unit tests leak memory in jQuery.cache" );
|
||||
oldCacheLength = cacheLength;
|
||||
@@ -200,7 +213,8 @@ window.Globals = (function() {
|
||||
globals = {};
|
||||
for ( name in current ) {
|
||||
supportjQuery.globalEval( "try { " +
|
||||
"delete " + ( supportjQuery.support.deleteExpando ? "window['" + name + "']" : name ) +
|
||||
"delete " +
|
||||
( supportjQuery.support.deleteExpando ? "window['" + name + "']" : name ) +
|
||||
"; } catch( x ) {}" );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user