mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Tests: Handle globals in .jshintrc.
(cherry picked from commit 2c43548ac6
)
This commit is contained in:
parent
14c7525853
commit
f9097a6d86
@ -77,16 +77,22 @@ TestHelpers.testJshint = function( module ) {
|
|||||||
dataType: "text"
|
dataType: "text"
|
||||||
})
|
})
|
||||||
).done(function( hintArgs, srcArgs ) {
|
).done(function( hintArgs, srcArgs ) {
|
||||||
var passed = JSHINT( srcArgs[ 0 ], hintArgs[ 0 ] ),
|
var globals, passed, errors,
|
||||||
errors = $.map( JSHINT.errors, function( error ) {
|
jshintrc = hintArgs[ 0 ],
|
||||||
// JSHINT may report null if there are too many errors
|
source = srcArgs[ 0 ];
|
||||||
if ( !error ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
return "[L" + error.line + ":C" + error.character + "] " +
|
globals = jshintrc.globals || {};
|
||||||
error.reason + "\n" + error.evidence + "\n";
|
delete jshintrc.globals;
|
||||||
}).join( "\n" );
|
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" );
|
||||||
ok( passed, errors );
|
ok( passed, errors );
|
||||||
start();
|
start();
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user