From 5abd381e07306054c102956b982c704dd8d3fb20 Mon Sep 17 00:00:00 2001 From: Charlike Mike Reagent Date: Fri, 6 Mar 2020 21:49:33 +0200 Subject: [PATCH] fix(devutils): unnecessary adding additional args Signed-off-by: Charlike Mike Reagent --- presets/dev/src/utils.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/presets/dev/src/utils.js b/presets/dev/src/utils.js index 2e34ad4..04c8181 100644 --- a/presets/dev/src/utils.js +++ b/presets/dev/src/utils.js @@ -13,22 +13,24 @@ exports.createJestCommand = function createJestCommand(prog) { .option('-e, --exclude', 'Ignore pattern string.') .option( '-I, --input', - 'Input patterns for the "lint" command, defaults to src and testing dirs.', + 'Input patterns for the command, defaults to src and testing dirs.', ) .option( '-m, --testPathPattern', - 'A regexp pattern string that is matched against all tests paths before executing the test.', + 'A regexp pattern string that is matched against all matched paths before executing.', ) .option( '-t, --testNamePattern', 'Run only tests with a name that matches the regex pattern', ) .option('-o, --onlyChanged', 'Run only on changed packages') - .action(async (argv) => { + .action(async function ssss(argv) { // switch the env set by default when running Jest. For ensurance. process.env.NODE_ENV = name; + // console.log(arguments); const opts = { ...argv }; + // console.log('xxxx', opts); const ignores = opts.exclude; const inputs = opts.input; @@ -49,6 +51,8 @@ exports.createJestCommand = function createJestCommand(prog) { delete opts[key]; }); + if (opts._) opts._.shift(); + const flags = toFlags(opts, { allowCamelCase: true }); // console.log(opts, flags); const configDir = path.join(__dirname, 'configs', name);