Skip to content

Commit

Permalink
refactor(protractor): simplify setting specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoffer Åström committed Jan 21, 2019
1 parent 75c5958 commit 427288b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
12 changes: 1 addition & 11 deletions commands/protractor/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ const { argv } = yargs
}
return config;
})
.coerce('specs', a => globby.sync(a).map(p => path.resolve(p)))
.coerce('babel', utils.coerceBabel);

argv.shouldInstrument = () => false;
Expand All @@ -392,17 +393,6 @@ if (argv.hookRequire) {
}

argv.require.map(require);
if (
(!argv.multiCapabilities
|| (argv.multiCapabilities && argv.multiCapabilities.length === 0))
&& (!argv.specs || (argv.specs && argv.specs.length === 0))
&& argv.glob.length
) {
const specs = utils
.filter(argv.filter.protractor.files, globby.sync(argv.glob))
.map(s => path.resolve(s));
argv.specs = specs;
}

// We need to change this relative to this config file so protractor can find it
if (argv.seleniumServerJar) {
Expand Down
4 changes: 2 additions & 2 deletions commands/protractor/src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ module.exports = {
},
test: {
description: 'Glob pattern',
type: 'string',
type: 'array',
default: TEST_GLOB,
alias: ['glob'],
alias: ['glob', 'specs'],
},
coverage: {
description: 'Generate coverage',
Expand Down

0 comments on commit 427288b

Please sign in to comment.