Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cypress): allow users to update cypress #6062

Merged
merged 1 commit into from Nov 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/@vue/cli-plugin-e2e-cypress/index.js
@@ -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