Skip to content

Commit

Permalink
chore: tweak wording when using conflicting CLI arguments (#13901)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminhobbs committed Mar 4, 2023
1 parent 4156f86 commit 679b5ad
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/jest-cli/src/args.ts
Expand Up @@ -15,8 +15,7 @@ export function check(argv: Config.Argv): true {
Object.prototype.hasOwnProperty.call(argv, 'maxWorkers')
) {
throw new Error(
'Both --runInBand and --maxWorkers were specified, but these two ' +
'options do not make sense together. Which is it?',
'Both --runInBand and --maxWorkers were specified, only one is allowed.',
);
}

Expand All @@ -28,17 +27,16 @@ export function check(argv: Config.Argv): true {
]) {
if (argv[key] && argv.watchAll) {
throw new Error(
`Both --${key} and --watchAll were specified, but these two ` +
'options do not make sense together. Try the --watch option which ' +
'reruns only tests related to changed files.',
`Both --${key} and --watchAll were specified, but cannot be used ` +
'together. Try the --watch option which reruns only tests ' +
'related to changed files.',
);
}
}

if (argv.onlyFailures && argv.watchAll) {
throw new Error(
'Both --onlyFailures and --watchAll were specified, but these two ' +
'options do not make sense together.',
'Both --onlyFailures and --watchAll were specified, only one is allowed.',
);
}

Expand Down

0 comments on commit 679b5ad

Please sign in to comment.