Skip to content

Commit 4638bba

Browse files
author
Gabriel Schulhof
committed
Build: Allow one to specify a specific test file within a suite
Closes jquery-archivegh-7507 Fixes jquery-archivegh-7506
1 parent b33ec10 commit 4638bba

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

Gruntfile.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -907,11 +907,20 @@ module.exports = function( grunt ) {
907907
.forEach( function( suite ) {
908908
testDirs.forEach( function( dir ) {
909909
dir = "tests/" + dir;
910-
patterns = patterns.concat([
911-
dir + "/" + suite + "/index.html",
912-
dir + "/" + suite + "/*/index.html",
913-
dir + "/" + suite + "/**/*-tests.html"
914-
]);
910+
911+
if ( suite.indexOf( "/" ) >= 0 ) {
912+
913+
// If the suite is a path, then append it exactly
914+
patterns.push( dir + "/" + suite );
915+
} else {
916+
917+
// If not, append all patterns we care about
918+
patterns = patterns.concat([
919+
dir + "/" + suite + "/index.html",
920+
dir + "/" + suite + "/*/index.html",
921+
dir + "/" + suite + "/**/*-tests.html"
922+
]);
923+
}
915924
});
916925
});
917926

0 commit comments

Comments
 (0)