Skip to content

Commit

Permalink
fix(nightwatch): compat with legacy presets without webdrivers field (
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang authored Jun 22, 2020
1 parent 5869f1f commit 222477e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/@vue/cli-plugin-e2e-nightwatch/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ module.exports = (api, { webdrivers }) => {
// Use devDependencies to store latest version number so as to automate update
const pluginDeps = require('../package.json').devDependencies

// In some legacy presets, they may forget to add a `webdrivers` field
// (which works fine before PR #5528).
// So we should add both drivers by default in that circumstance.
if (typeof webdrivers === 'undefined') {
webdrivers = ['firefox', 'chrome']
}

if (webdrivers && webdrivers.includes('firefox')) {
devDependencies.geckodriver = pluginDeps.geckodriver
}
Expand Down

0 comments on commit 222477e

Please sign in to comment.