From e031e2e6c1abe30fd2a00d53ece64a9187fabfd1 Mon Sep 17 00:00:00 2001 From: chenos Date: Sun, 22 May 2022 21:38:15 +0800 Subject: [PATCH] fix(cli): nocobase test command --db-clean option is invalid --- packages/core/cli/src/commands/test.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/core/cli/src/commands/test.js b/packages/core/cli/src/commands/test.js index 7934b1ba43..0764beb483 100644 --- a/packages/core/cli/src/commands/test.js +++ b/packages/core/cli/src/commands/test.js @@ -14,7 +14,15 @@ module.exports = (cli) => { nodeCheck(); if (options.dbClean) { promptForTs(); - await runAppCommand('db:clean', '-y'); + await runAppCommand('db:clean', ['-y']); + } + let index = process.argv.indexOf('-c'); + if (index > 0) { + process.argv.splice(index, 1); + } + index = process.argv.indexOf('--db-clean'); + if (index > 0) { + process.argv.splice(index, 1); } process.argv.splice(2, 1, '-i'); require('jest-cli/bin/jest');