File tree 2 files changed +31
-5
lines changed
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
+
1
4
var through = require ( 'through2' )
2
5
var duplexer = require ( 'duplexer2' )
3
6
var parser = require ( 'tap-out' )
4
- var format = require ( 'ansi-escape' )
7
+ var format = showAnsi ? require ( 'ansi-escape' ) : require ( './no-ansi ')
5
8
var symbols = require ( 'figures' )
6
9
var prettyMs = require ( 'pretty-ms' )
7
10
var LF = '\n'
@@ -29,17 +32,23 @@ module.exports = function () {
29
32
} ,
30
33
start : new Date ( ) ,
31
34
}
32
- output . push ( LF + format . cha . eraseLine . escape ( '# ' + test . title ) )
35
+ if ( showProgress ) {
36
+ output . push ( LF + format . cha . eraseLine . escape ( '# ' + test . title ) )
37
+ }
33
38
} )
34
39
35
40
tap . on ( 'pass' , function ( ) {
36
41
++ test . pass
37
- output . push ( format . cha . eraseLine . escape ( '# ' + test . title ) )
42
+ if ( showProgress ) {
43
+ output . push ( format . cha . eraseLine . escape ( '# ' + test . title ) )
44
+ }
38
45
} )
39
46
40
47
tap . on ( 'fail' , function ( ) {
41
48
++ test . fail
42
- output . push ( format . cha . eraseLine . escape ( '# ' + test . title ) )
49
+ if ( showProgress ) {
50
+ output . push ( format . cha . eraseLine . escape ( '# ' + test . title ) )
51
+ }
43
52
} )
44
53
45
54
tap . on ( 'output' , function ( res ) {
@@ -163,4 +172,3 @@ function prettifyError(assertion) {
163
172
}
164
173
return format . cyan . escape ( ret . join ( LF ) )
165
174
}
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