From 427288bd0f2dd23ef91356041dca6c7502ab74c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoffer=20=C3=85str=C3=B6m?= Date: Mon, 21 Jan 2019 10:06:31 +0100 Subject: [PATCH] refactor(protractor): simplify setting specs --- commands/protractor/src/config.js | 12 +----------- commands/protractor/src/options.js | 4 ++-- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/commands/protractor/src/config.js b/commands/protractor/src/config.js index f4c43a25..abda0494 100644 --- a/commands/protractor/src/config.js +++ b/commands/protractor/src/config.js @@ -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; @@ -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) { diff --git a/commands/protractor/src/options.js b/commands/protractor/src/options.js index 35fac333..360cec33 100644 --- a/commands/protractor/src/options.js +++ b/commands/protractor/src/options.js @@ -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',