File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,13 +26,13 @@ ${color.yellow(' $ rs fmt [options] [files/globs...]')}
2626Format files with Prettier.
2727
2828${ color . cyan ( 'Options' ) } :
29- --write Write formatted files in place (default)
30- --check Check whether files are formatted
31- --list-different Print paths of unformatted files
32- --ignore-path <path> Path to an additional ignore file (repeatable)
29+ --write Write formatted files in place (default)
30+ --check Check whether files are formatted
31+ --list-different Print paths of unformatted files
32+ --ignore-path <path> Path to an additional ignore file (repeatable)
3333 --parallel-workers <count> Number of parallel workers
34- --stdin-filepath <path> Format stdin as if it were saved at <path>
35- -h, --help Display this help message` ;
34+ --stdin-filepath <path> Format stdin as if it were saved at <path>
35+ -h, --help Display this help message` ;
3636
3737const parseMaxWorkers = (
3838 kebabValue : string | undefined ,
Original file line number Diff line number Diff line change 1+ // Rstest Snapshot v1
2+
3+ exports [` provides command help 1` ] = `
4+ "Usage:
5+ $ rs fmt [options] [files/globs...]
6+
7+ Format files with Prettier.
8+
9+ Options:
10+ --write Write formatted files in place (default)
11+ --check Check whether files are formatted
12+ --list-different Print paths of unformatted files
13+ --ignore-path <path > Path to an additional ignore file (repeatable)
14+ --parallel-workers <count > Number of parallel workers
15+ --stdin-filepath <path > Format stdin as if it were saved at <path >
16+ -h, --help Display this help message"
17+ `;
Original file line number Diff line number Diff line change @@ -139,14 +139,10 @@ test('rejects file arguments with --stdin-filepath', () => {
139139} ) ;
140140
141141test ( 'provides command help' , ( ) => {
142- expect ( fmtHelpMessage ) . toContain ( 'Usage:\n $ rs fmt [options] [files/globs...]' ) ;
143- expect ( fmtHelpMessage ) . toContain ( '--write' ) ;
144- expect ( fmtHelpMessage ) . toContain ( '--check' ) ;
145- expect ( fmtHelpMessage ) . toContain ( '--list-different' ) ;
146- expect ( fmtHelpMessage ) . toContain ( '--ignore-path <path>' ) ;
147- expect ( fmtHelpMessage ) . toContain ( '--parallel-workers <count>' ) ;
148- expect ( fmtHelpMessage ) . toContain ( '--stdin-filepath <path>' ) ;
149- expect ( fmtHelpMessage ) . toContain ( '-h, --help' ) ;
142+ const helpMessage = stripVTControlCharacters ( fmtHelpMessage ) . replace ( / ^ R s t a c k v .* \n \n / , '' ) ;
143+
144+ expect ( helpMessage ) . toContain ( 'Usage:\n $ rs fmt [options] [files/globs...]' ) ;
145+ expect ( helpMessage ) . toMatchSnapshot ( ) ;
150146} ) ;
151147
152148test . each ( [
You can’t perform that action at this time.
0 commit comments