From 3fe9afb0ab0d2e52fafe05c1d9e2199430a2f0d5 Mon Sep 17 00:00:00 2001 From: Jake Date: Thu, 15 Jul 2021 16:07:47 +0800 Subject: [PATCH] feat(vant-cli): support jest options (#9038) --- packages/vant-cli/src/commands/jest.ts | 4 ++++ packages/vant-cli/src/index.ts | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/packages/vant-cli/src/commands/jest.ts b/packages/vant-cli/src/commands/jest.ts index 368d49d19..08220dc17 100644 --- a/packages/vant-cli/src/commands/jest.ts +++ b/packages/vant-cli/src/commands/jest.ts @@ -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]) diff --git a/packages/vant-cli/src/index.ts b/packages/vant-cli/src/index.ts index 90c069af3..411970e51 100755 --- a/packages/vant-cli/src/index.ts +++ b/packages/vant-cli/src/index.ts @@ -37,6 +37,22 @@ command('test') '--clearCache', 'Clears the configured Jest cache directory and then exits' ) + .option( + '--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')