@@ -14,12 +14,13 @@ function replaceSpecDuration(str) {
1414 return str
1515 . replaceAll ( / \( 0 ( \r ? \n ) m s \) / g, '(ZEROms)' )
1616 . replaceAll ( / [ 0 - 9 . ] + m s / g, '*ms' )
17- . replaceAll ( / d u r a t i o n _ m s [ 0 - 9 . ] + / g, 'duration_ms *' ) ;
17+ . replaceAll ( / d u r a t i o n _ m s [ 0 - 9 . ] + / g, 'duration_ms *' )
18+ . replace ( new RegExp ( `(\\[\\d+m)\\(${ process . cwd ( ) } /?(\\[\\d+m)(.*)(\\[\\d+m)\\)` , 'g' ) , '$3' ) ;
1819}
1920const defaultTransform = snapshot
2021 . transform ( snapshot . replaceWindowsLineEndings , snapshot . replaceStackTrace , replaceTestDuration ) ;
2122const specTransform = snapshot
22- . transform ( snapshot . replaceWindowsLineEndings , snapshot . replaceStackTrace , replaceSpecDuration ) ;
23+ . transform ( replaceSpecDuration , snapshot . replaceWindowsLineEndings , snapshot . replaceStackTrace ) ;
2324
2425
2526const tests = [
@@ -40,10 +41,11 @@ const tests = [
4041 { name : 'test-runner/output/name_pattern.js' } ,
4142 { name : 'test-runner/output/name_pattern_with_only.js' } ,
4243 { name : 'test-runner/output/unresolved_promise.js' } ,
43- ] . map ( ( { name, transform } ) => ( {
44+ { name : 'test-runner/output/default_output.js' , transform : specTransform , tty : true } ,
45+ ] . map ( ( { name, tty, transform } ) => ( {
4446 name,
4547 fn : common . mustCall ( async ( ) => {
46- await snapshot . spawnAndAssert ( fixtures . path ( name ) , transform ?? defaultTransform ) ;
48+ await snapshot . spawnAndAssert ( fixtures . path ( name ) , transform ?? defaultTransform , { tty } ) ;
4749 } ) ,
4850} ) ) ;
4951
0 commit comments