@@ -20,12 +20,17 @@ export const check = (argv: Argv) => {
2020 ) ;
2121 }
2222
23- if ( argv . onlyChanged && argv . watchAll ) {
24- throw new Error (
25- 'Both --onlyChanged and --watchAll were specified, but these two ' +
26- 'options do not make sense together. Try the --watch option which ' +
27- 'reruns only tests related to changed files.' ,
28- ) ;
23+ for ( const key of [ 'onlyChanged' , 'lastCommit' , 'changedFilesWithAncestor' ] ) {
24+ if ( argv [ key ] ) {
25+ argv . onlyChanged = true ;
26+ }
27+ if ( argv [ key ] && argv . watchAll ) {
28+ throw new Error (
29+ `Both --${ key } and --watchAll were specified, but these two ` +
30+ 'options do not make sense together. Try the --watch option which ' +
31+ 'reruns only tests related to changed files.' ,
32+ ) ;
33+ }
2934 }
3035
3136 if ( argv . findRelatedTests && argv . _ . length === 0 ) {
@@ -104,8 +109,8 @@ export const options = {
104109 } ,
105110 changedFilesWithAncestor : {
106111 description :
107- 'When used together with `--onlyChanged` or `--watch`, it runs tests ' +
108- 'related to the current changes and the changes made in the last commit. ' ,
112+ 'Runs tests related to the current changes and the changes made in the ' +
113+ 'last commit. Behaves similarly to `--onlyChanged`. ' ,
109114 type : 'boolean' ,
110115 } ,
111116 ci : {
@@ -267,8 +272,8 @@ export const options = {
267272 lastCommit : {
268273 default : undefined ,
269274 description :
270- 'When used together with `--onlyChanged`, it will run all tests ' +
271- 'affected by file changes in the last commit made .' ,
275+ 'Run all tests affected by file changes in the last commit made. ' +
276+ 'Behaves similarly to `--onlyChanged` .' ,
272277 type : 'boolean' ,
273278 } ,
274279 listTests : {
@@ -353,7 +358,7 @@ export const options = {
353358 description :
354359 'Attempts to identify which tests to run based on which ' +
355360 "files have changed in the current repository. Only works if you're " +
356- 'running tests in a git repository at the moment.' ,
361+ 'running tests in a git or hg repository at the moment.' ,
357362 type : 'boolean' ,
358363 } ,
359364 onlyFailures : {
0 commit comments