Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Gruntfile.js: Make sure paths are unique /after/ having stripped off …
Browse files Browse the repository at this point in the history
…the index.html.

(cherry picked from commit 0f21e34)
  • Loading branch information
Gabriel Schulhof committed Mar 12, 2013
1 parent eca12c4 commit b8b0911
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ module.exports = function( grunt ) {
urls: (function() {
// Find the test files
var suites = grunt.util._.without( ( grunt.option( "suites" ) || "" ).split( "," ), "" ),
patterns, paths, idx, onePath = "", uniquePaths = [],
patterns, paths, idx,
onePath = "",
uniquePaths = [],
versionedPaths = [],
jQueries = grunt.util._.without( ( grunt.option( "jqueries" ) || "" ).split( "," ), "" );

Expand All @@ -374,18 +376,20 @@ module.exports = function( grunt ) {
patterns = [ "tests/unit/*/index.html", "tests/unit/*/*/index.html", "tests/unit/**/*-tests.html" ];
}

paths = grunt.file.expand( patterns ).sort();
paths = grunt.file.expand( patterns )
.sort()
.map( function( path ) {
// Some of our tests (ie. navigation) don't like having the index.html too much
return path.replace( /\/\index.html$/, "/" );
});

for ( idx in paths ) {
if ( onePath !== paths[ idx ] ) {
onePath = paths[ idx ];
uniquePaths.push( onePath );
}
}

uniquePaths.map( function( path ) {
// Some of our tests (ie. navigation) don't like having the index.html too much
return path.replace( /\/\index.html$/, "/" );
});
paths = uniquePaths;

if ( jQueries.length ) {
paths.forEach( function( path ) {
Expand Down

0 comments on commit b8b0911

Please sign in to comment.