aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2021-06-07 00:58:12 +0200
committerGitHub <noreply@github.com>2021-06-07 00:58:12 +0200
commit70dae67b73dfea9126f126f516fe8286f1e73417 (patch)
treee61eafab41ee74330fecf1da2ce125050cfac49b /tests/lib
parenta12c98574d07f002fd59d166f9fc1fd391581b91 (diff)
downloadjquery-ui-70dae67b73dfea9126f126f516fe8286f1e73417.tar.gz
jquery-ui-70dae67b73dfea9126f126f516fe8286f1e73417.zip
Build: Migrate from JSHint & JSCS to ESLint
Fixes #15393 Closes gh-1958
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/bootstrap.js4
-rw-r--r--tests/lib/common.js54
-rw-r--r--tests/lib/css.js1
-rw-r--r--tests/lib/qunit-assert-domequal.js1
-rw-r--r--tests/lib/qunit.js7
5 files changed, 6 insertions, 61 deletions
diff --git a/tests/lib/bootstrap.js b/tests/lib/bootstrap.js
index 5dcc2702e..fff019332 100644
--- a/tests/lib/bootstrap.js
+++ b/tests/lib/bootstrap.js
@@ -1,4 +1,5 @@
( function() {
+"use strict";
var DEFAULT_JQUERY_VERSION = "1.12.4";
@@ -9,7 +10,6 @@ requirejs.config( {
"jquery": jqueryUrl(),
"jquery-migrate": migrateUrl(),
"jquery-simulate": "../../../external/jquery-simulate/jquery.simulate",
- "jshint": "../../../external/jshint/jshint",
"lib": "../../lib",
"phantom-bridge": "../../../node_modules/grunt-contrib-qunit/phantomjs/bridge",
"qunit-assert-classes": "../../../external/qunit-assert-classes/qunit-assert-classes",
@@ -128,7 +128,7 @@ function migrateUrl() {
url = "../../../external/jquery-migrate-1.4.1/jquery-migrate";
} else if ( jqueryVersion === "custom" ) {
if ( parseUrl().migrate ) {
- throw new Error ( "Migrate not currently supported for custom build" );
+ throw new Error( "Migrate not currently supported for custom build" );
}
} else {
throw new Error( "No migrate version known for jQuery " + jqueryVersion );
diff --git a/tests/lib/common.js b/tests/lib/common.js
index dbb9eea8b..56b7a3ff3 100644
--- a/tests/lib/common.js
+++ b/tests/lib/common.js
@@ -3,6 +3,7 @@ define( [
"jquery",
"lib/helper"
], function( QUnit, $, helper ) {
+"use strict";
var exports = {};
@@ -69,7 +70,6 @@ function testBasicUsage( widget ) {
exports.testWidget = function( widget, settings ) {
QUnit.module( widget + ": common widget", { afterEach: helper.moduleAfterEach } );
- exports.testJshint( "/widgets/" + widget );
testWidgetDefaults( widget, settings.defaults );
testWidgetOverrides( widget );
if ( !settings.noDefaultElement ) {
@@ -81,58 +81,6 @@ exports.testWidget = function( widget, settings ) {
} );
};
-exports.testJshint = function( module ) {
-
- // Function.prototype.bind check is needed because JSHint doesn't work in ES3 browsers anymore
- // https://github.com/jshint/jshint/issues/1384
- if ( QUnit.urlParams.nojshint || !Function.prototype.bind ) {
- return;
- }
-
- QUnit.test( "JSHint", function( assert ) {
- var ready = assert.async();
- require( [ "jshint" ], function() {
- assert.expect( 1 );
-
- $.when(
- $.ajax( {
- url: "../../../ui/.jshintrc",
- dataType: "json"
- } ),
- $.ajax( {
- url: "../../../ui/" + module + ".js",
- dataType: "text"
- } )
- )
- .done( function( hintArgs, srcArgs ) {
- var globals, passed, errors,
- jshintrc = hintArgs[ 0 ],
- source = srcArgs[ 0 ];
-
- globals = jshintrc.globals || {};
- delete jshintrc.globals;
- passed = JSHINT( source, jshintrc, globals );
- errors = $.map( JSHINT.errors, function( error ) {
-
- // JSHINT may report null if there are too many errors
- if ( !error ) {
- return;
- }
-
- return "[L" + error.line + ":C" + error.character + "] " +
- error.reason + "\n" + error.evidence + "\n";
- } ).join( "\n" );
- assert.ok( passed, errors );
- ready();
- } )
- .fail( function( hintError, srcError ) {
- assert.ok( false, "error loading source: " + ( hintError || srcError ).statusText );
- ready();
- } );
- } );
- } );
-};
-
return exports;
} );
diff --git a/tests/lib/css.js b/tests/lib/css.js
index ab707ad2a..bd7fb49ad 100644
--- a/tests/lib/css.js
+++ b/tests/lib/css.js
@@ -1,4 +1,5 @@
( function() {
+"use strict";
function includeStyle( url ) {
document.write( "<link rel='stylesheet' href='../../../" + url + "'>" );
diff --git a/tests/lib/qunit-assert-domequal.js b/tests/lib/qunit-assert-domequal.js
index 26c131137..bdad9844c 100644
--- a/tests/lib/qunit-assert-domequal.js
+++ b/tests/lib/qunit-assert-domequal.js
@@ -8,6 +8,7 @@ define( [
"qunit",
"jquery"
], function( QUnit, $ ) {
+"use strict";
var domEqual = QUnit.assert.domEqual = function( selector, modifier, message ) {
diff --git a/tests/lib/qunit.js b/tests/lib/qunit.js
index 1395e7c84..425f0fc8f 100644
--- a/tests/lib/qunit.js
+++ b/tests/lib/qunit.js
@@ -6,17 +6,12 @@ define( [
"lib/qunit-assert-domequal",
"phantom-bridge"
], function( QUnit, $ ) {
+"use strict";
QUnit.config.autostart = false;
QUnit.config.requireExpects = true;
QUnit.config.urlConfig.push( {
- id: "nojshint",
- label: "Skip JSHint",
- tooltip: "Skip running JSHint, e.g., within TestSwarm, where Jenkins runs it already"
-} );
-
-QUnit.config.urlConfig.push( {
id: "jquery",
label: "jQuery version",
value: [