@@ -24,29 +24,32 @@ class VerboseReporter {
24
24
return '' ;
25
25
}
26
26
test ( test , runStatus ) {
27
+ const lines = [ ] ;
27
28
if ( test . error ) {
28
- return ' ' + colors . error ( figures . cross ) + ' ' + test . title + ' ' + colors . error ( test . error . message ) ;
29
- }
30
-
31
- if ( test . todo ) {
32
- return ' ' + colors . todo ( '- ' + test . title ) ;
29
+ lines . push ( ' ' + colors . error ( figures . cross ) + ' ' + test . title + ' ' + colors . error ( test . error . message ) ) ;
30
+ } else if ( test . todo ) {
31
+ lines . push ( ' ' + colors . todo ( '- ' + test . title ) ) ;
33
32
} else if ( test . skip ) {
34
- return ' ' + colors . skip ( '- ' + test . title ) ;
35
- }
33
+ lines . push ( ' ' + colors . skip ( '- ' + test . title ) ) ;
34
+ } else if ( test . failing ) {
35
+ lines . push ( ' ' + colors . error ( figures . tick ) + ' ' + colors . error ( test . title ) ) ;
36
+ } else if ( runStatus . fileCount === 1 && runStatus . testCount === 1 && test . title === '[anonymous]' ) {
37
+ // No output
38
+ } else {
39
+ // Display duration only over a threshold
40
+ const threshold = 100 ;
41
+ const duration = test . duration > threshold ? colors . duration ( ' (' + prettyMs ( test . duration ) + ')' ) : '' ;
36
42
37
- if ( test . failing ) {
38
- return ' ' + colors . error ( figures . tick ) + ' ' + colors . error ( test . title ) ;
43
+ lines . push ( ' ' + colors . pass ( figures . tick ) + ' ' + test . title + duration ) ;
39
44
}
40
45
41
- if ( runStatus . fileCount === 1 && runStatus . testCount === 1 && test . title === '[anonymous]' ) {
42
- return undefined ;
46
+ if ( test . comments ) {
47
+ test . comments . forEach ( comment => {
48
+ lines . push ( ' ' + colors . information ( figures . info ) + ' ' + colors . comment ( comment ) ) ;
49
+ } ) ;
43
50
}
44
51
45
- // Display duration only over a threshold
46
- const threshold = 100 ;
47
- const duration = test . duration > threshold ? colors . duration ( ' (' + prettyMs ( test . duration ) + ')' ) : '' ;
48
-
49
- return ' ' + colors . pass ( figures . tick ) + ' ' + test . title + duration ;
52
+ return lines . length > 0 ? lines . join ( '\n' ) : undefined ;
50
53
}
51
54
unhandledError ( err ) {
52
55
if ( err . type === 'exception' && err . name === 'AvaError' ) {
0 commit comments