11import { execFileSync } from 'node:child_process' ;
22import { mkdtemp , rm , writeFile } from 'node:fs/promises' ;
33import path from 'node:path' ;
4- import { stripVTControlCharacters } from 'node:util' ;
54import { test } from '#test-helpers' ;
65
76const git = ( cwd : string , args : string [ ] ) : void => {
@@ -64,7 +63,7 @@ const withGitFixture = async (callback: (cwd: string) => Promise<void> | void):
6463} ;
6564
6665test ( 'should display the staged help message' , ( { execCli, expect } ) => {
67- const output = stripVTControlCharacters ( execCli ( 'staged --help' ) ) ;
66+ const output = execCli ( 'staged --help' ) ;
6867
6968 expect ( output ) . toContain ( 'Rstack v' ) ;
7069 expect ( output ) . toContain ( 'Usage:\n $ rs staged [options]' ) ;
@@ -79,18 +78,6 @@ test('should display the staged help message', ({ execCli, expect }) => {
7978 expect ( output ) . toContain ( '-h, --help' ) ;
8079} ) ;
8180
82- test ( 'should display the colorized staged help message' , ( { execCli, expect } ) => {
83- const output = execCli ( 'staged -h' , {
84- env : {
85- FORCE_COLOR : '1' ,
86- } ,
87- } ) ;
88-
89- expect ( output ) . toContain ( '\x1b[36mUsage\x1b[39m:' ) ;
90- expect ( output ) . toContain ( '\x1b[33m $ rs staged [options]\x1b[39m' ) ;
91- expect ( output ) . toContain ( '\x1b[36mOptions\x1b[39m:' ) ;
92- } ) ;
93-
9481test ( 'should reject unknown staged options' , ( { execCli, expect } ) => {
9582 expect ( ( ) => execCli ( 'staged --unknown' ) ) . toThrow ( ) ;
9683} ) ;
0 commit comments