@@ -35,7 +35,7 @@ import { annotateStacktrace } from '../core/stacktrace';
3535 * Objects with cyclical references will be stringifed as
3636 * "[Circular]" as they cannot otherwise be represented.
3737 */
38- function prettyYamlValue ( value , indent = 4 ) {
38+ function prettyYamlValue ( value , indent = 2 ) {
3939 if ( value === undefined ) {
4040 // Not supported in JSON/YAML, turn into string
4141 // and let the below output it as bare string.
@@ -94,7 +94,7 @@ function prettyYamlValue (value, indent = 4) {
9494
9595 // See also <https://yaml-multiline.info/>
9696 // Support IE 9-11: Avoid ES6 String#repeat
97- const prefix = ( new Array ( indent + 1 ) ) . join ( ' ' ) ;
97+ const prefix = ( new Array ( ( indent * 2 ) + 1 ) ) . join ( ' ' ) ;
9898
9999 const trailingLinebreakMatch = value . match ( / \n + $ / ) ;
100100 const trailingLinebreaks = trailingLinebreakMatch
@@ -126,8 +126,13 @@ function prettyYamlValue (value, indent = 4) {
126126 }
127127 }
128128
129+ const prefix = ( new Array ( indent + 1 ) ) . join ( ' ' ) ;
130+
129131 // Handle null, boolean, array, and object
130- return JSON . stringify ( decycledShallowClone ( value ) , null , 2 ) ;
132+ return JSON . stringify ( decycledShallowClone ( value ) , null , 2 )
133+ . split ( '\n' )
134+ . map ( ( line , i ) => i === 0 ? line : prefix + line )
135+ . join ( '\n' ) ;
131136}
132137
133138/**
@@ -223,11 +228,11 @@ export default class TapReporter {
223228 this . log ( `ok ${ this . testCount } ${ test . fullName . join ( ' > ' ) } ` ) ;
224229 } else if ( test . status === 'skipped' ) {
225230 this . log (
226- `ok ${ this . testCount } ${ kleur . yellow ( `# SKIP ${ test . fullName . join ( ' > ' ) } ` ) } `
231+ `ok ${ this . testCount } ${ kleur . yellow ( test . fullName . join ( ' > ' ) ) } # SKIP `
227232 ) ;
228233 } else if ( test . status === 'todo' ) {
229234 this . log (
230- `not ok ${ this . testCount } ${ kleur . cyan ( `# TODO ${ test . fullName . join ( ' > ' ) } ` ) } `
235+ `not ok ${ this . testCount } ${ kleur . cyan ( test . fullName . join ( ' > ' ) ) } # TODO `
231236 ) ;
232237 test . errors . forEach ( ( error ) => this . logAssertion ( error , 'todo' ) ) ;
233238 } else {
0 commit comments