Skip to content

Commit 8e4c8b8

Browse files
committed
use node-glob instead of wildcard for better pattern support
node-glob is located here: <https://github.com/isaacs/node-glob> It supports common filename glob patterns, including patterns like: `'**/*.js'`. This commit allows vows to be called, for example, like this: `vows --spec '**/test-*.js'`.
1 parent a7843f4 commit 8e4c8b8

File tree

3 files changed

+4
-122
lines changed

3 files changed

+4
-122
lines changed

bin/vows

+3-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
var path = require('path'),
55
fs = require('fs'),
66
util = require('util'),
7-
wildcard = require('../lib/utils/wildcard').wildcard,
7+
glob = require('glob'),
88
NopStream = require('../lib/utils/nopstream').NopStream,
99
events = require('events');
1010

@@ -270,12 +270,8 @@ if (! options.watch) {
270270
// preprocess the list of files for any wildcards. win32 does not handle wildcards before calling vows
271271
// any paths not containing wildcards are simple returned by wildcard()
272272
files.forEach(function(a) {
273-
if(a.indexOf('*') !== -1) {
274-
wildcardFiles = wildcardFiles.concat(wildcard(a));
275-
} else {
276-
wildcardFiles.push(a);
277-
}
278-
});
273+
wildcardFiles = wildcardFiles.concat(glob.sync(a));
274+
});
279275

280276
// now set up the file list for vows including all the wildcard files
281277
files = wildcardFiles.map(function (a) {

lib/utils/wildcard.js

-114
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"keywords" : ["testing", "spec", "test", "BDD"],
66
"author" : "Alexis Sellier <self@cloudhead.net>",
77
"contributors" : [{ "name": "Charlie Robbins", "email": "charlie.robbins@gmail.com" }],
8-
"dependencies" : {"eyes": ">=0.1.6", "diff": "~1.0.3"},
8+
"dependencies" : {"eyes": ">=0.1.6", "diff": "~1.0.3", "glob": "3.1.x"},
99
"main" : "./lib/vows",
1010
"bin" : {"vows": "./bin/vows"},
1111
"directories" : {"test": "./test", "bin": "./bin"},

0 commit comments

Comments
 (0)