aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/common.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/common.js')
-rw-r--r--tests/lib/common.js54
1 files changed, 1 insertions, 53 deletions
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;
} );