aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-04-29 20:22:31 -0400
committerScott González <scott.gonzalez@gmail.com>2012-04-29 20:22:52 -0400
commit27072de09443eff51fdc6559658a7870c4d7824d (patch)
treecceb7975580720e2ceac674dd8ddf374c1579427 /tests
parent24d978f8331a0b4e3bc4dc35eaa88a7f9a47c5fd (diff)
downloadjquery-ui-27072de09443eff51fdc6559658a7870c4d7824d.tar.gz
jquery-ui-27072de09443eff51fdc6559658a7870c4d7824d.zip
Tests: Run JSHint.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/core/core.js2
-rw-r--r--tests/unit/effects/effects_core.js8
-rw-r--r--tests/unit/position/position_core.js2
-rw-r--r--tests/unit/testsuite.js13
-rw-r--r--tests/unit/widget/widget_core.js6
5 files changed, 25 insertions, 6 deletions
diff --git a/tests/unit/core/core.js b/tests/unit/core/core.js
index 79d1d4034..099ac468c 100644
--- a/tests/unit/core/core.js
+++ b/tests/unit/core/core.js
@@ -2,6 +2,8 @@
module( "core - jQuery extensions" );
+TestHelpers.testJshint( "ui.core" );
+
test( "focus - original functionality", function() {
expect( 1 );
$( "#inputTabindex0" )
diff --git a/tests/unit/effects/effects_core.js b/tests/unit/effects/effects_core.js
index 93c7da114..d3b5179e2 100644
--- a/tests/unit/effects/effects_core.js
+++ b/tests/unit/effects/effects_core.js
@@ -128,10 +128,16 @@ asyncTest( "animateClass: css and class changes during animation are not lost (#
$.each( $.effects.effect, function( effect ) {
+ module( "effects." + effect );
+
+ // puff and size are defined inside scale
+ if ( effect !== "puff" && effect !== "size" ) {
+ TestHelpers.testJshint( "effects." + effect );
+ }
+
if ( effect === "transfer" ) {
return;
}
- module( "effect."+effect );
asyncTest( "show/hide", function() {
expect( 8 );
var hidden = $( "div.hidden" ),
diff --git a/tests/unit/position/position_core.js b/tests/unit/position/position_core.js
index e68e310f1..4a2240311 100644
--- a/tests/unit/position/position_core.js
+++ b/tests/unit/position/position_core.js
@@ -16,6 +16,8 @@ module( "position", {
}
});
+TestHelpers.testJshint( "ui.position" );
+
test( "my, at, of", function() {
expect( 4 );
diff --git a/tests/unit/testsuite.js b/tests/unit/testsuite.js
index faef90a9d..a6710930b 100644
--- a/tests/unit/testsuite.js
+++ b/tests/unit/testsuite.js
@@ -27,12 +27,17 @@ TestHelpers.loadResources = QUnit.urlParams.min ?
};
QUnit.config.urlConfig.push( "nojshint" );
-function testJshint( widget ) {
+var jshintLoaded = false;
+TestHelpers.testJshint = function( module ) {
if ( QUnit.urlParams.nojshint ) {
return;
}
- includeScript( "external/jshint.js" );
+ if ( !jshintLoaded ) {
+ includeScript( "external/jshint.js" );
+ jshintLoaded = true;
+ }
+
asyncTest( "JSHint", function() {
expect( 1 );
@@ -42,7 +47,7 @@ function testJshint( widget ) {
dataType: "json"
}),
$.ajax({
- url: "../../../ui/jquery.ui." + widget + ".js",
+ url: "../../../ui/jquery." + module + ".js",
dataType: "text"
})
).done(function( hintArgs, srcArgs ) {
@@ -121,7 +126,7 @@ function testBasicUsage( widget ) {
TestHelpers.commonWidgetTests = function( widget, settings ) {
module( widget + ": common widget" );
- testJshint( widget );
+ TestHelpers.testJshint( "ui." + widget );
testWidgetDefaults( widget, settings.defaults );
testWidgetOverrides( widget );
testBasicUsage( widget );
diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js
index 38495e282..aa70e2425 100644
--- a/tests/unit/widget/widget_core.js
+++ b/tests/unit/widget/widget_core.js
@@ -2,10 +2,14 @@
module( "widget factory", {
teardown: function() {
- delete $.ui.testWidget;
+ if ( $.ui ) {
+ delete $.ui.testWidget;
+ }
}
});
+TestHelpers.testJshint( "ui.widget" );
+
test( "widget creation", function() {
var myPrototype = {
_create: function() {},