Files
vue-cli/packages/@vue/cli/lib/promptModules/e2e.js
2018-01-18 00:25:07 +01:00

35 lines
785 B
JavaScript

module.exports = cli => {
cli.injectFeature({
name: 'E2E Testing',
value: 'e2e',
short: 'E2E'
})
cli.injectPrompt({
name: 'e2e',
when: answers => answers.features.includes('e2e'),
type: 'list',
message: 'Pick a E2E testing solution:',
choices: [
{
name: 'Cypress (Chrome only)',
value: 'cypress',
short: 'Cypress'
},
{
name: 'Nightwatch (Selenium-based)',
value: 'nightwatch',
short: 'Nightwatch'
}
]
})
cli.onPromptComplete((answers, options) => {
if (answers.e2e === 'cypress') {
options.plugins['@vue/cli-plugin-e2e-cypress'] = {}
} else if (answers.e2e === 'nightwatch') {
options.plugins['@vue/cli-plugin-e2e-nightwatch'] = {}
}
})
}