File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -571,7 +571,20 @@ function importSuites(files) {
571
571
//f = path.join(process.cwd(), path.relative(process.cwd(),f));
572
572
var obj = require ( f ) ;
573
573
return suites . concat ( Object . keys ( obj ) . map ( function ( s ) {
574
- obj [ s ] . _filename = cwdname ( f ) ;
574
+ try {
575
+ obj [ s ] . _filename = cwdname ( f ) ;
576
+ } catch ( e ) {
577
+ if ( e instanceof TypeError && typeof ( obj [ s ] ) === 'undefined' ) {
578
+ abort ( "runner" ,
579
+ "Caught a TypeError while trying to import " +
580
+ "suites: a suite is undefined." +
581
+ "Check your exports; are you doing something like " +
582
+ "exports.suite = vows.describe('foo')." +
583
+ "addBatch({}).run()? If so, remove '.run()'" ) ;
584
+ } else {
585
+ throw e ;
586
+ }
587
+ }
575
588
return obj [ s ] ;
576
589
} ) ) ;
577
590
} , [ ] )
You can’t perform that action at this time.
0 commit comments