File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 1+ var runTests = require ( './test.js' )
2+ runTests ( '[a-m]*.js' )
Original file line number Diff line number Diff line change 1+ var runTests = require ( './test.js' )
2+ runTests ( '[n-z]*.js' )
Original file line number Diff line number Diff line change @@ -11,11 +11,17 @@ function regEsc (str) {
1111 return str . replace ( / [ \- \[ \] \/ \{ \} \( \) \* \+ \? \. \\ \^ \$ \| ] / g, '\\$&' )
1212}
1313
14- if ( process . argv [ 2 ] ) {
15- var file = path . resolve ( dir , process . argv [ 2 ] )
16- runTests ( file )
17- } else {
18- glob . sync ( dir + '*.js' ) . forEach ( runTests )
14+ if ( module === require . main ) {
15+ if ( process . argv [ 2 ] ) {
16+ var file = path . resolve ( dir , process . argv [ 2 ] )
17+ runTests ( file )
18+ } else {
19+ t . pass ( 'just a common file' )
20+ }
21+ }
22+
23+ module . exports = function ( pattern ) {
24+ glob . sync ( dir + pattern ) . forEach ( runTests )
1925}
2026
2127function runTests ( file ) {
You can’t perform that action at this time.
0 commit comments