File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,15 @@ else
272
272
if ( bail )
273
273
process . env . TAP_BAIL = '1'
274
274
275
+ var glob = require ( 'glob' )
276
+ files = files . reduce ( function ( acc , f ) {
277
+ // glob claims patterns MUST not include any '\'s
278
+ if ( ! / \\ / . test ( f ) ) {
279
+ f = glob . sync ( f ) || f
280
+ }
281
+ return acc . concat ( f )
282
+ } , [ ] )
283
+
275
284
if ( files . length === 0 ) {
276
285
console . error ( 'Reading TAP data from stdin (use "-" argument to suppress)' )
277
286
files . push ( '-' )
Original file line number Diff line number Diff line change @@ -101,6 +101,21 @@ t.test('bailout args', function (t) {
101
101
t . end ( )
102
102
} )
103
103
104
+ t . test ( 'path globbing' , function ( t ) {
105
+ var glob = 'fixtures/*-success.js'
106
+ var opt = { env : { TAP : 1 } , cwd : __dirname }
107
+ var child = spawn ( node , [ run , glob ] , opt )
108
+ var out = ''
109
+ child . stdout . on ( 'data' , function ( c ) {
110
+ out += c
111
+ } )
112
+ child . on ( 'close' , function ( code ) {
113
+ t . equal ( code , 0 , 'exits successfully' )
114
+ t . match ( out , / t r i v i a l - s u c c e s s .j s / g, 'includes a matched file' )
115
+ t . end ( )
116
+ } )
117
+ } )
118
+
104
119
t . test ( 'save-file' , function ( t ) {
105
120
var saveFile = 'runner-save-test'
106
121
function saveFileTest ( cb ) {
You can’t perform that action at this time.
0 commit comments