File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,14 @@ var common = require('./common');
2323var assert = require ( 'assert' ) ;
2424var events = require ( '../' ) ;
2525
26+ // Redirect warning output to tape.
27+ var consoleWarn = console . warn ;
28+ console . warn = common . test . comment ;
29+
30+ common . test . on ( 'end' , function ( ) {
31+ console . warn = consoleWarn ;
32+ } ) ;
33+
2634// default
2735{
2836 var e = new events . EventEmitter ( ) ;
Original file line number Diff line number Diff line change 11var test = require ( 'tape' ) ;
22
33require ( './legacy-compat' ) ;
4+ var common = require ( './common' ) ;
45
56// we do this to easily wrap each file in a mocha test
67// and also have browserify be able to statically analyze this file
78var orig_require = require ;
89var require = function ( file ) {
910 test ( file , function ( t ) {
11+ // Store the tape object so tests can access it.
12+ t . on ( 'end' , function ( ) { delete common . test ; } ) ;
13+ common . test = t ;
14+
1015 try { orig_require ( file ) ; } catch ( err ) { t . fail ( err ) ; }
1116 t . end ( ) ;
1217 } ) ;
You can’t perform that action at this time.
0 commit comments