Skip to content

Commit

Permalink
fix(devutils): unnecessary adding additional args
Browse files Browse the repository at this point in the history
Signed-off-by: Charlike Mike Reagent <[email protected]>
  • Loading branch information
tunnckoCore committed Mar 6, 2020
1 parent 19b2dc6 commit 5abd381
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions presets/dev/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 5abd381

Please sign in to comment.