mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Make compatible with jshint, lint test/data. Close gh-1043.
This commit is contained in:
committed by
Richard Gibson
parent
26bf8dd56b
commit
5dd8a90f73
3
test/.jshintignore
Normal file
3
test/.jshintignore
Normal file
@@ -0,0 +1,3 @@
|
||||
qunit/
|
||||
data/badjson.js
|
||||
data/jquery-1.8.2.ajax_xhr.min.js
|
||||
112
test/.jshintrc
112
test/.jshintrc
@@ -1,61 +1,55 @@
|
||||
{
|
||||
"options": {
|
||||
"browser": true,
|
||||
"curly": true,
|
||||
"devel": true,
|
||||
"eqnull": true,
|
||||
"evil": true,
|
||||
"expr": true,
|
||||
"maxerr": 100,
|
||||
"quotmark": "double",
|
||||
"smarttabs": true,
|
||||
"sub": true,
|
||||
"trailing": true,
|
||||
"undef": true,
|
||||
"wsh": true
|
||||
},
|
||||
"globals": {
|
||||
"define": true,
|
||||
"DOMParser": true,
|
||||
"__dirname": true,
|
||||
"jQuery": true,
|
||||
"global": true,
|
||||
"module": true,
|
||||
"exports": true,
|
||||
"require": true,
|
||||
"file": true,
|
||||
"log": true,
|
||||
"QUnit": true,
|
||||
"ok": true,
|
||||
"equal": true,
|
||||
"test": true,
|
||||
"asyncTest": true,
|
||||
"notEqual": true,
|
||||
"deepEqual": true,
|
||||
"strictEqual": true,
|
||||
"notStrictEqual": true,
|
||||
"start": true,
|
||||
"stop": true,
|
||||
"expect": true,
|
||||
"raises": true,
|
||||
"ajaxTest": true,
|
||||
"testIframe": true,
|
||||
"testIframeWithCallback": true,
|
||||
"createDashboardXML": true,
|
||||
"createXMLFragment": true,
|
||||
"moduleTeardown": true,
|
||||
"testFoo": true,
|
||||
"url": true,
|
||||
"t": true,
|
||||
"q": true,
|
||||
"amdDefined": true,
|
||||
"fireNative": true,
|
||||
"Globals": true,
|
||||
"hasPHP": true,
|
||||
"isLocal": true,
|
||||
"originaljQuery": true,
|
||||
"$": true,
|
||||
"original$": true,
|
||||
"externalHost": true
|
||||
}
|
||||
"curly": true,
|
||||
"expr": true,
|
||||
"quotmark": "double",
|
||||
"trailing": true,
|
||||
"undef": true,
|
||||
"maxerr": 100,
|
||||
|
||||
"eqnull": true,
|
||||
"evil": true,
|
||||
"smarttabs": true,
|
||||
"sub": true,
|
||||
|
||||
"browser": true,
|
||||
"devel": true,
|
||||
"wsh": true,
|
||||
|
||||
"predef": [
|
||||
"DOMParser",
|
||||
"jQuery",
|
||||
"QUnit",
|
||||
"module",
|
||||
"ok",
|
||||
"equal",
|
||||
"test",
|
||||
"asyncTest",
|
||||
"notEqual",
|
||||
"deepEqual",
|
||||
"strictEqual",
|
||||
"notStrictEqual",
|
||||
"start",
|
||||
"stop",
|
||||
"expect",
|
||||
"raises",
|
||||
"ajaxTest",
|
||||
"testIframe",
|
||||
"testIframeWithCallback",
|
||||
"createDashboardXML",
|
||||
"createXMLFragment",
|
||||
"moduleTeardown",
|
||||
"testFoo",
|
||||
"url",
|
||||
"t",
|
||||
"q",
|
||||
"amdDefined",
|
||||
"fireNative",
|
||||
"Globals",
|
||||
"hasPHP",
|
||||
"isLocal",
|
||||
"originaljQuery",
|
||||
"$",
|
||||
"original$",
|
||||
"externalHost"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
var testBar = "bar";
|
||||
jQuery('#ap').html('bar');
|
||||
jQuery("#ap").html("bar");
|
||||
ok( true, "test.js executed");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*jshint multistr:true */
|
||||
/*jshint multistr:true, quotmark:false */
|
||||
|
||||
var amdDefined, fireNative,
|
||||
originaljQuery = this.jQuery || "jQuery",
|
||||
@@ -207,7 +207,7 @@ function ajaxTest( title, expect, options ) {
|
||||
}
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
(function () {
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ var Globals = (function() {
|
||||
// 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 );
|
||||
@@ -243,9 +243,9 @@ var Globals = (function() {
|
||||
}
|
||||
};
|
||||
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'
|
||||
id: "jqdata",
|
||||
label: "Always check jQuery.data",
|
||||
tooltip: "Trigger QUnit.expectJqData detection for all tests instead of just the ones that call it"
|
||||
} );
|
||||
|
||||
/**
|
||||
@@ -265,14 +265,14 @@ var Globals = (function() {
|
||||
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' );
|
||||
deepEqual( actualKeys, expectedKeys, "Expected keys exist in jQuery.cache" );
|
||||
}
|
||||
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 + ')' );
|
||||
deepEqual( expectedDataKeys[i], undefined, "No unexpected keys were left in jQuery.cache (#" + i + ")" );
|
||||
delete expectedDataKeys[i];
|
||||
}
|
||||
}
|
||||
@@ -359,5 +359,5 @@ QUnit.config.requireExpects = true;
|
||||
return;
|
||||
}
|
||||
|
||||
document.write("<scr" + "ipt src='http://swarm.jquery.org/js/inject.js?" + (new Date).getTime() + "'></scr" + "ipt>");
|
||||
document.write("<scr" + "ipt src='http://swarm.jquery.org/js/inject.js?" + (new Date()).getTime() + "'></scr" + "ipt>");
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user