Skip to content
Permalink
Browse files

Tests: Run JSHint.

  • Loading branch information...
scottgonzalez committed Apr 30, 2012
1 parent 24d978f commit 27072de09443eff51fdc6559658a7870c4d7824d
@@ -2,6 +2,8 @@

module( "core - jQuery extensions" );

TestHelpers.testJshint( "ui.core" );

test( "focus - original functionality", function() {
expect( 1 );
$( "#inputTabindex0" )
@@ -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" ),
@@ -16,6 +16,8 @@ module( "position", {
}
});

TestHelpers.testJshint( "ui.position" );

test( "my, at, of", function() {
expect( 4 );

@@ -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 );
@@ -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() {},

0 comments on commit 27072de

Please sign in to comment.
You can’t perform that action at this time.