@@ -30,7 +30,8 @@ function validateDiffBehaviors(args: undefined|string|string[]) {
30
30
}
31
31
}
32
32
if ( failed . length > 0 ) {
33
- throw new Error ( `Invalid options for --on-diff: ${ failed } ` ) ;
33
+ throw new Error (
34
+ `Invalid options for --on-diff: ${ failed } . Valid options are: ${ Object . values ( DiffBehaviors ) . join ( ', ' ) } ` ) ;
34
35
}
35
36
return asArray ( args ) ;
36
37
}
@@ -39,13 +40,21 @@ function validateDiffBehaviors(args: undefined|string|string[]) {
39
40
export function commandLineArgs ( yargs : any ) {
40
41
return yargs . parserConfiguration ( { 'camel-case-expansion' : false } )
41
42
. command ( '$0 [tests..]' )
42
- . option ( 'debug' , { type : 'boolean' } )
43
- . option ( 'coverage' , { type : 'boolean' } )
44
- . option ( 'chrome-binary' , { type : 'string' } )
45
- . option ( 'repeat' , { type : 'number' , default : 1 } )
46
- . option ( 'on-diff' , { type : 'string' , coerce : validateDiffBehaviors } )
47
- . option ( 'shuffle' , { type : 'boolean' } )
48
- . option ( 'grep' , { type : 'string' , conflicts : 'fgrep' } )
49
- . option ( 'fgrep' , { type : 'string' , conflicts : 'grep' } )
50
- . option ( 'invert-grep' , { type : 'boolean' } ) ;
43
+ . option (
44
+ 'artifacts-dir' ,
45
+ { type : 'string' , desc : 'Path to a directory to store test artifacts in (e.g., coverage reports)' } )
46
+ . option ( 'debug' , { type : 'boolean' , desc : 'Execute tests in debug mode' } )
47
+ . option ( 'coverage' , { type : 'boolean' , desc : 'Enable coverage reporting' } )
48
+ . option ( 'chrome-binary' , { type : 'string' , desc : 'Run tests with a custom chrome binary' } )
49
+ . option ( 'repeat' , { type : 'number' , default : 1 , desc : 'Repeat tests' } )
50
+ . option ( 'on-diff' , {
51
+ type : 'string' ,
52
+ coerce : validateDiffBehaviors ,
53
+ desc : `Define how to deal with diffs in snapshots/screenshots. Options are: ${
54
+ Object . values ( DiffBehaviors ) . join ( ', ' ) } `,
55
+ } )
56
+ . option ( 'shuffle' , { type : 'boolean' , desc : 'Execute tests in random order' } )
57
+ . option ( 'grep' , { type : 'string' , conflicts : 'fgrep' , desc : 'Filter tests by name using grep' } )
58
+ . option ( 'fgrep' , { type : 'string' , conflicts : 'grep' , desc : 'Filter tests by name using fgrep' } )
59
+ . option ( 'invert-grep' , { type : 'boolean' , desc : 'Invert the grep/fgrep result' } ) ;
51
60
}
0 commit comments