@@ -430,8 +430,8 @@ test('should work with relative formatter path', async () => {
430
430
431
431
test ( 'should print help' , async ( ) => {
432
432
const cwd = await gitBootstrap ( 'fixtures/default' ) ;
433
- const actual = await cli ( [ '--help' ] , { cwd} ) ( ) ;
434
- expect ( escapeCwd ( actual . stdout , cwd ) ) . toMatchInlineSnapshot ( `
433
+ const actual = await cli ( [ '--help' , '--cwd' , './' ] , { cwd} ) ( ) ;
434
+ expect ( actual . stdout ) . toMatchInlineSnapshot ( `
435
435
"@commitlint/[email protected] - Lint your commit messages
436
436
437
437
[input] reads from stdin if --edit, --env, --from and --to are omitted
@@ -440,7 +440,7 @@ test('should print help', async () => {
440
440
--color, -c toggle colored output [boolean] [default: true]
441
441
--config, -g path to the config file [string]
442
442
--cwd, -d directory to execute in
443
- [string] [default: \\"__CWD__\\" ]
443
+ [string] [default: (Working Directory) ]
444
444
--edit, -e read last commit message from the specified file or
445
445
fallbacks to ./.git/COMMIT_EDITMSG
446
446
[string] [default: false]
@@ -475,9 +475,3 @@ async function writePkg(payload: unknown, options: TestOptions) {
475
475
const result = merge ( pkg , payload ) ;
476
476
await fs . writeFile ( pkgPath , JSON . stringify ( result , null , ' ' ) ) ;
477
477
}
478
-
479
- function escapeCwd ( value : string , cwd : string ) : string {
480
- return value
481
- . replace ( cwd , '__CWD__' )
482
- . replace ( / ( \n [ ] + ) ( .+ _ _ C W D _ _ ) / , `$1${ ' ' . repeat ( cwd . length - 7 ) } $2` ) ;
483
- }
0 commit comments