@@ -3,6 +3,7 @@ import { mkdtempSync, mkdirSync, rmSync, symlinkSync, writeFileSync } from 'node
33import { tmpdir } from 'node:os' ;
44import { join , relative } from 'node:path' ;
55import { fileURLToPath } from 'node:url' ;
6+ import { stripVTControlCharacters } from 'node:util' ;
67import { describe , expect , it } from 'vite-plus/test' ;
78import { deletedFiles , planAffectedTests , type TestFile } from '../../../../test/affected-tests.ts' ;
89import { changedFiles , createAffectedVcsProvider } from '../../../../test/affected-vcs.ts' ;
@@ -352,13 +353,14 @@ it('executes conservative integration consumers without an import edge', () => {
352353 '-e' ,
353354 `import { runAffected } from ${ JSON . stringify ( runner ) } ; await runAffected(${ JSON . stringify ( root ) } , {});` ,
354355 ] ,
355- { cwd : root , encoding : 'utf8' , timeout : 15_000 } ,
356+ { cwd : root , encoding : 'utf8' , timeout : 15_000 , env : { ... process . env , FORCE_COLOR : '1' } } ,
356357 ) ;
357358 expect ( result . error ) . toBeUndefined ( ) ;
358359 expect ( result . status , result . stdout + result . stderr ) . toBe ( 0 ) ;
359- expect ( result . stdout ) . toContain ( 'Selected 1/2 test files' ) ;
360- expect ( result . stdout ) . toContain ( 'Test Files 1 passed' ) ;
361- expect ( result . stdout ) . toContain ( 'Tests 1 passed' ) ;
360+ const output = stripVTControlCharacters ( result . stdout ) ;
361+ expect ( output ) . toContain ( 'Selected 1/2 test files' ) ;
362+ expect ( output ) . toContain ( 'Test Files 1 passed' ) ;
363+ expect ( output ) . toContain ( 'Tests 1 passed' ) ;
362364 } finally {
363365 rmSync ( root , { recursive : true , force : true } ) ;
364366 }
0 commit comments