Skip to content

Commit

Permalink
fix(cypress): allow users to update cypress (#6062)
Browse files Browse the repository at this point in the history
  • Loading branch information
elevatebart authored and haoqunjiang committed Nov 17, 2020
1 parent d06a1e8 commit fcab190
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/@vue/cli-plugin-e2e-cypress/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = (api, options) => {
const { info, chalk, execa } = require('@vue/cli-shared-utils')
const { info, chalk, execa, resolveModule } = require('@vue/cli-shared-utils')

api.registerCommand('test:e2e', {
description: 'run e2e tests with Cypress',
Expand Down Expand Up @@ -31,7 +31,9 @@ module.exports = (api, options) => {
...rawArgs
]

const cypressBinPath = require.resolve('cypress/bin/cypress')
// Use loadModule to allow users to customize their Cypress dependency version.
const cypressBinPath = resolveModule('cypress/bin/cypress', api.getCwd()) ||
resolveModule('cypress/bin/cypress', __dirname)
const runner = execa(cypressBinPath, cyArgs, { stdio: 'inherit' })
if (server) {
runner.on('exit', () => server.close())
Expand Down

0 comments on commit fcab190

Please sign in to comment.