Tests: Run JSHint.

This commit is contained in:
Scott González 2012-04-29 20:22:31 -04:00
parent 24d978f833
commit 27072de094
5 changed files with 25 additions and 6 deletions

View File

@ -2,6 +2,8 @@
module( "core - jQuery extensions" );
TestHelpers.testJshint( "ui.core" );
test( "focus - original functionality", function() {
expect( 1 );
$( "#inputTabindex0" )

View File

@ -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" ),

View File

@ -16,6 +16,8 @@ module( "position", {
}
});
TestHelpers.testJshint( "ui.position" );
test( "my, at, of", function() {
expect( 4 );

View File

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

View File

@ -2,10 +2,14 @@
module( "widget factory", {
teardown: function() {
if ( $.ui ) {
delete $.ui.testWidget;
}
}
});
TestHelpers.testJshint( "ui.widget" );
test( "widget creation", function() {
var myPrototype = {
_create: function() {},