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
+3 -101
View File
@@ -429,110 +429,12 @@ Options:
### `backstage-cli repo test`
```
Usage: backstage-cli [--config=<pathToConfigFile>] [TestPathPattern]
Usage: backstage-cli repo test [options]
Options:
--since <ref>
--jest-help
-h, --help
--version
--all
--automock
-b, --bail
--cache
--cacheDirectory
--changedFilesWithAncestor
--changedSince
--ci
--clearCache
--clearMocks
--collectCoverage
--collectCoverageFrom
--color
--colors
-c, --config
--coverage
--coverageDirectory
--coveragePathIgnorePatterns
--coverageProvider
--coverageReporters
--coverageThreshold
--debug
--detectLeaks
--detectOpenHandles
--env
--errorOnDeprecated
-e, --expand
--filter
--findRelatedTests
--forceExit
--globalSetup
--globalTeardown
--globals
--haste
--ignoreProjects
--init
--injectGlobals
--json
--lastCommit
--listTests
--logHeapUsage
--maxConcurrency
-w, --maxWorkers
--moduleDirectories
--moduleFileExtensions
--moduleNameMapper
--modulePathIgnorePatterns
--modulePaths
--noStackTrace
--notify
--notifyMode
-o, --onlyChanged
-f, --onlyFailures
--outputFile
--passWithNoTests
--preset
--prettierPath
--projects
--reporters
--resetMocks
--resetModules
--resolver
--restoreMocks
--rootDir
--roots
-i, --runInBand
--runTestsByPath
--runner
--selectProjects
--setupFiles
--setupFilesAfterEnv
--shard
--showConfig
--silent
--skipFilter
--snapshotSerializers
--testEnvironment
--testEnvironmentOptions
--testFailureExitCode
--testLocationInResults
--testMatch
-t, --testNamePattern
--testPathIgnorePatterns
--testPathPattern
--testRegex
--testResultsProcessor
--testRunner
--testSequencer
--testTimeout
--transform
--transformIgnorePatterns
--unmockedModulePathPatterns
-u, --updateSnapshot
--useStderr
--verbose
--watch
--watchAll
--watchPathIgnorePatterns
--watchman
```
### `backstage-cli test`
+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);
}