File tree Expand file tree Collapse file tree 2 files changed +31
-5
lines changed
Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Original file line number Diff line number Diff line change 1+ var showAnsi = false
2+ var showProgress = false
3+
14var through = require ( 'through2' )
25var duplexer = require ( 'duplexer2' )
36var parser = require ( 'tap-out' )
4- var format = require ( 'ansi-escape' )
7+ var format = showAnsi ? require ( 'ansi-escape' ) : require ( './no-ansi ')
58var symbols = require ( 'figures' )
69var prettyMs = require ( 'pretty-ms' )
710var LF = '\n'
@@ -29,17 +32,23 @@ module.exports = function () {
2932 } ,
3033 start : new Date ( ) ,
3134 }
32- output . push ( LF + format . cha . eraseLine . escape ( '# ' + test . title ) )
35+ if ( showProgress ) {
36+ output . push ( LF + format . cha . eraseLine . escape ( '# ' + test . title ) )
37+ }
3338 } )
3439
3540 tap . on ( 'pass' , function ( ) {
3641 ++ test . pass
37- output . push ( format . cha . eraseLine . escape ( '# ' + test . title ) )
42+ if ( showProgress ) {
43+ output . push ( format . cha . eraseLine . escape ( '# ' + test . title ) )
44+ }
3845 } )
3946
4047 tap . on ( 'fail' , function ( ) {
4148 ++ test . fail
42- output . push ( format . cha . eraseLine . escape ( '# ' + test . title ) )
49+ if ( showProgress ) {
50+ output . push ( format . cha . eraseLine . escape ( '# ' + test . title ) )
51+ }
4352 } )
4453
4554 tap . on ( 'output' , function ( res ) {
@@ -163,4 +172,3 @@ function prettifyError(assertion) {
163172 }
164173 return format . cyan . escape ( ret . join ( LF ) )
165174}
166-
Original file line number Diff line number Diff line change 1+ var LF = '\n'
2+
3+ var escapes = require ( 'ansi-escape/lib/escapes' )
4+ var colors = require ( 'ansi-escape/lib/colors' )
5+
6+ var escape = function ( x ) { return x }
7+
8+ Object . keys ( colors ) . forEach ( function ( key ) {
9+ escape [ key ] = escape
10+ } )
11+
12+ Object . keys ( escapes ) . forEach ( function ( key ) {
13+ escape [ key ] = escape
14+ } )
15+
16+ escape . eraseLine . escape = function ( x ) { return x + LF }
17+
18+ module . exports = escape
You can’t perform that action at this time.
0 commit comments