11import os from 'node:os' ;
22import path from 'node:path' ;
3+ import { stripVTControlCharacters } from 'node:util' ;
34
45import indentString from 'indent-string' ;
56import plur from 'plur' ;
6- import stripAnsi from 'strip-ansi' ;
77import * as supertap from 'supertap' ;
88
99import prefixTitle from './prefix-title.js' ;
@@ -20,7 +20,7 @@ function dumpError({
2020 if ( type === 'unknown' ) {
2121 return {
2222 message : 'Non-native error' ,
23- formatted : stripAnsi ( formattedError ) ,
23+ formatted : stripVTControlCharacters ( formattedError ) ,
2424 } ;
2525 }
2626
@@ -33,8 +33,8 @@ function dumpError({
3333
3434 if ( formattedDetails . length > 0 ) {
3535 originalError . details = Object . fromEntries ( formattedDetails . map ( ( { label, formatted} ) => [
36- stripAnsi ( label ) ,
37- stripAnsi ( formatted ) ,
36+ stripVTControlCharacters ( label ) ,
37+ stripVTControlCharacters ( formatted ) ,
3838 ] ) ) ;
3939 }
4040 }
@@ -119,7 +119,7 @@ export default class TapReporter {
119119 }
120120
121121 writeComment ( evt , { title = this . prefixTitle ( evt . testFile , evt . title ) } ) {
122- this . reportStream . write ( `# ${ stripAnsi ( title ) } ${ os . EOL } ` ) ;
122+ this . reportStream . write ( `# ${ stripVTControlCharacters ( title ) } ${ os . EOL } ` ) ;
123123 if ( evt . logs ) {
124124 for ( const log of evt . logs ) {
125125 const logLines = indentString ( log , 4 ) . replaceAll ( / ^ { 4 } / gm, '# ' ) ;
0 commit comments