Permalink
Browse files

Don't match on filenames if given explicitly on the command line

  • Loading branch information...
1 parent 93a21f6 commit abd080e9bf979b2fd14c04f755c002e42f5dbab0 @nornagon committed Mar 3, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 bin/zap
View
@@ -77,18 +77,18 @@ if (process.argv[2] === '--one') {
test_files = test_files.concat(allTestFiles(target))
})
- function allTestFiles(pth) {
+ function allTestFiles(pth, match) {
var stats = fs.statSync(pth)
if (stats.isFile()) {
- if (pth.match(/\.test\.js$/)) {
+ if (!match || pth.match(match)) {
return [path.resolve(pth)]
} else {
return []
}
} else if (stats.isDirectory()) {
var paths = []
fs.readdirSync(pth).forEach(function (file) {
- paths = paths.concat(allTestFiles(path.join(pth, file)))
+ paths = paths.concat(allTestFiles(path.join(pth, file), /\.test\.js$/))
})
return paths
} else {

0 comments on commit abd080e

Please sign in to comment.