mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-06 14:39:48 -06:00
Add --e2e and --component CLI options
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -137,7 +137,7 @@ const processRunOptions = (options = {}) => {
|
||||
args.push('--tag', options.tag)
|
||||
}
|
||||
|
||||
args.push(...processTestingType(options.testingType))
|
||||
args.push(...processTestingType(options))
|
||||
|
||||
return args
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user