feat(vant-cli): support jest options (#9038)

This commit is contained in:
Jake 2021-07-15 16:07:47 +08:00 committed by GitHub
parent 485e313b37
commit 3fe9afb0ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -15,6 +15,10 @@ export function test(command: any) {
watch: command.watch,
config: JEST_CONFIG_FILE,
clearCache: command.clearCache,
changedSince: command.changedSince,
logHeapUsage: command.logHeapUsage,
runInBand: command.runInBand,
debug: command.debug,
} as any;
runCLI(config, [ROOT])

View File

@ -37,6 +37,22 @@ command('test')
'--clearCache',
'Clears the configured Jest cache directory and then exits'
)
.option(
'--changedSince <changedSince>',
'Runs tests related to the changes since the provided branch or commit hash'
)
.option(
'--logHeapUsage',
'Logs the heap usage after every test. Useful to debug memory leaks'
)
.option(
'--runInBand',
'Run all tests serially in the current process, rather than creating a worker pool of child processes that run tests'
)
.option(
'--debug',
'Print debugging info about your Jest config'
)
.action(test);
command('clean')