mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Tests: Run JSHint.
This commit is contained in:
parent
24d978f833
commit
27072de094
@ -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() {},
|
||||
|
Loading…
Reference in New Issue
Block a user