File tree Expand file tree Collapse file tree 4 files changed +11
-18
lines changed
e2e/cli-e2e/tests/__snapshots__ Expand file tree Collapse file tree 4 files changed +11
-18
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,9 @@ Commands:
1818
1919
2020Global Options:
21- --verbose When true creates more verbose output. This is helpful w
22- hen debugging. You may also set CP_VERBOSE env variable
23- instead . [boolean] [default: false ]
21+ --verbose Toggles whether to print debug logs. The default value is de
22+ rived from the CP_VERBOSE environment variable (false if not
23+ set) . [boolean ]
2424 --config Path to config file. By default it loads code-pushup.con
2525 fig.(ts|mjs|js). [string]
2626 --tsconfig Path to a TypeScript config, to be used when loading con
Original file line number Diff line number Diff line change @@ -195,11 +195,11 @@ Each example is fully tested to demonstrate best practices for plugin testing as
195195
196196# ## Global Options
197197
198- | Option | Type | Default | Description |
199- | ---------------- | --------- | -------------------------------------------- | -------------------------------------------------------------------- ------------------------------------------------------ |
200- | **`--verbose`** | `boolean` | `false` | When true creates more verbose output. This is helpful when debugging. You may also set `CP_VERBOSE` env variable instead. |
201- | **`--config`** | `string` | looks for `code-pushup.config.{ts\|mjs\|js}` | Path to config file. |
202- | **`--tsconfig`** | `string` | n/a | Path to a TypeScript config, used to load config file. |
198+ | Option | Type | Default | Description |
199+ | ---------------- | --------- | ----------------------------------------------------- | ------------------------------------------------------ |
200+ | **`--verbose`** | `boolean` | `process.env['CP_VERBOSE']` if set, otherwise `false` | Toggles whether to print debug logs. |
201+ | **`--config`** | `string` | looks for `code-pushup.config.{ts\|mjs\|js}` | Path to config file. |
202+ | **`--tsconfig`** | `string` | n/a | Path to a TypeScript config, used to load config file. |
203203
204204> [!NOTE]
205205> By default, the CLI loads `code-pushup.config.(ts|mjs|js)` if no config path is provided with `--config`.
Original file line number Diff line number Diff line change @@ -8,9 +8,8 @@ export function yargsGlobalOptionsDefinition(): Record<
88 return {
99 verbose : {
1010 describe :
11- 'When true creates more verbose output. This is helpful when debugging. You may also set CP_VERBOSE env variable instead .' ,
11+ 'Toggles whether to print debug logs. The default value is derived from the CP_VERBOSE environment variable (false if not set) .' ,
1212 type : 'boolean' ,
13- default : false ,
1413 } ,
1514 config : {
1615 describe :
Original file line number Diff line number Diff line change @@ -16,13 +16,6 @@ import { options } from './options.js';
1616import { yargsCli } from './yargs-cli.js' ;
1717
1818describe ( 'yargsCli' , ( ) => {
19- it ( 'should provide correct default values for global options' , async ( ) => {
20- const parsedArgv = await yargsCli < GlobalOptions > ( [ ] , {
21- options,
22- } ) . parseAsync ( ) ;
23- expect ( parsedArgv . verbose ) . toBe ( false ) ;
24- } ) ;
25-
2619 it ( 'should parse an empty array as a default onlyPlugins option' , async ( ) => {
2720 const parsedArgv = await yargsCli < GlobalOptions & FilterOptions > ( [ ] , {
2821 options : { ...options , ...yargsFilterOptionsDefinition ( ) } ,
@@ -144,7 +137,8 @@ describe('yargsCli', () => {
144137 expect ( parsedArgv ) . toEqual (
145138 expect . objectContaining ( {
146139 // default values
147- verbose : false ,
140+ onlyCategories : [ ] ,
141+ skipCategories : [ ] ,
148142 // overridden arguments
149143 persist : expect . objectContaining ( {
150144 outputDir : 'code-pushdown/output/dir' ,
You can’t perform that action at this time.
0 commit comments