cli: flip repo command help options to use --jest-help instead

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-09-20 13:54:49 +02:00
parent 6d00e80146
commit 947a9f2165
3 changed files with 10 additions and 103 deletions
+4 -1
View File
@@ -80,7 +80,10 @@ export function registerRepoCommand(program: Command) {
'--since <ref>',
'Only test packages that changed since the specified ref',
)
.helpOption(', --backstage-cli-help') // Let Jest handle help
.option(
'--jest-help',
'Show help for Jest CLI options, which are passed through',
)
.description('Run tests, forwarding args to Jest, defaulting to watch mode')
.action(lazy(() => import('./repo/test').then(m => m.command)));
}
+3 -1
View File
@@ -118,7 +118,9 @@ export async function command(opts: OptionValues, cmd: Command): Promise<void> {
}
// This ensures that the process doesn't exit too early before stdout is flushed
if (args.includes('--help')) {
if (args.includes('--jest-help')) {
removeOptionArg(args, '--jest-help');
args.push('--help');
(process.stdout as any)._handle.setBlocking(true);
}