@@ -30,6 +30,7 @@ const symbols = {
3030 'test:pass' : '\u2714 ' ,
3131 'test:diagnostic' : '\u2139 ' ,
3232 'arrow:right' : '\u25B6 ' ,
33+ 'hyphen:minus' : '\uFE63 ' ,
3334} ;
3435class SpecReporter extends Transform {
3536 #stack = [ ] ;
@@ -60,8 +61,8 @@ class SpecReporter extends Transform {
6061 return `\n${ indent } ${ message } \n` ;
6162 }
6263 #handleEvent( { type, data } ) {
63- const color = colors [ type ] ?? white ;
64- const symbol = symbols [ type ] ?? ' ' ;
64+ let color = colors [ type ] ?? white ;
65+ let symbol = symbols [ type ] ?? ' ' ;
6566
6667 switch ( type ) {
6768 case 'test:fail' :
@@ -81,15 +82,20 @@ class SpecReporter extends Transform {
8182 ArrayPrototypeUnshift ( this . #reported, msg ) ;
8283 prefix += `${ this . #indent( msg . nesting ) } ${ symbols [ 'arrow:right' ] } ${ msg . name } \n` ;
8384 }
85+ const skippedSubtest = subtest && data . skip && data . skip !== undefined ;
8486 const indent = this . #indent( data . nesting ) ;
8587 const duration_ms = data . details ?. duration_ms ? ` ${ gray } (${ data . details . duration_ms } ms)${ white } ` : '' ;
86- const title = `${ data . name } ${ duration_ms } ` ;
88+ const title = `${ data . name } ${ duration_ms } ${ skippedSubtest ? ' # SKIP' : '' } ` ;
8789 if ( this . #reported[ 0 ] && this . #reported[ 0 ] . nesting === data . nesting && this . #reported[ 0 ] . name === data . name ) {
88- // If this test has had children - it was already reporter , so slightly modify the output
90+ // If this test has had children - it was already reported , so slightly modify the output
8991 ArrayPrototypeShift ( this . #reported) ;
9092 return `${ prefix } ${ indent } ${ color } ${ symbols [ 'arrow:right' ] } ${ white } ${ title } \n\n` ;
9193 }
9294 const error = this . #formatError( data . details ?. error , indent ) ;
95+ if ( skippedSubtest ) {
96+ color = gray ;
97+ symbol = symbols [ 'hyphen:minus' ] ;
98+ }
9399 return `${ prefix } ${ indent } ${ color } ${ symbol } ${ title } ${ error } ${ white } \n` ;
94100 }
95101 case 'test:start' :
0 commit comments