Skip to content

Commit fcab190

Browse files
elevatebarthaoqunjiang
authored andcommitted
fix(cypress): allow users to update cypress (#6062)
1 parent d06a1e8 commit fcab190

File tree

1 file changed

+4
-2
lines changed
  • packages/@vue/cli-plugin-e2e-cypress

1 file changed

+4
-2
lines changed

packages/@vue/cli-plugin-e2e-cypress/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = (api, options) => {
2-
const { info, chalk, execa } = require('@vue/cli-shared-utils')
2+
const { info, chalk, execa, resolveModule } = require('@vue/cli-shared-utils')
33

44
api.registerCommand('test:e2e', {
55
description: 'run e2e tests with Cypress',
@@ -31,7 +31,9 @@ module.exports = (api, options) => {
3131
...rawArgs
3232
]
3333

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

0 commit comments

Comments
 (0)