Add --e2e and --component CLI options

This commit is contained in:
BlueWinds
2021-10-05 10:02:54 -07:00
parent 98a9c06c40
commit e01d3acfe8
7 changed files with 36 additions and 10 deletions

View File

@@ -36,7 +36,7 @@ module.exports = {
args.push('--project', options.project)
}
args.push(...processTestingType(options.testingType))
args.push(...processTestingType(options))
debug('opening from options %j', options)
debug('command line arguments %j', args)

View File

@@ -137,7 +137,7 @@ const processRunOptions = (options = {}) => {
args.push('--tag', options.tag)
}
args.push(...processTestingType(options.testingType))
args.push(...processTestingType(options))
return args
}

View File

@@ -23,16 +23,16 @@ const throwInvalidOptionError = (details) => {
* @param {string} testingType The type of tests being executed
* @returns {string[]} The array of new exec arguments
*/
const processTestingType = (testingType) => {
if (testingType) {
if (testingType === 'e2e') {
return ['--testing-type', 'e2e']
}
const processTestingType = (options) => {
if (options.testingType === 'component' || options.component) {
return ['--testing-type', 'component']
}
if (testingType === 'component') {
return ['--testing-type', 'component']
}
if (options.testingType === 'e2e' || options.e2e) {
return ['--testing-type', 'e2e']
}
if (options.testingType) {
return throwInvalidOptionError(errors.invalidTestingType)
}