From 679b5adc1fbad7a744bb7a53458060ec2532db09 Mon Sep 17 00:00:00 2001 From: Benjamin Hobbs <15235276+benjaminhobbs@users.noreply.github.com> Date: Sat, 4 Mar 2023 12:00:49 +0400 Subject: [PATCH] chore: tweak wording when using conflicting CLI arguments (#13901) --- packages/jest-cli/src/args.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/jest-cli/src/args.ts b/packages/jest-cli/src/args.ts index ec62bdfc5a6b..56d21754c926 100644 --- a/packages/jest-cli/src/args.ts +++ b/packages/jest-cli/src/args.ts @@ -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.', ); } @@ -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.', ); }