From c045cad08f1a977972c218b491964221ca3f0a40 Mon Sep 17 00:00:00 2001 From: ElevateBart Date: Mon, 16 Nov 2020 11:27:14 -0600 Subject: [PATCH] fix(cypress): allow users to update cypress --- packages/@vue/cli-plugin-e2e-cypress/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/@vue/cli-plugin-e2e-cypress/index.js b/packages/@vue/cli-plugin-e2e-cypress/index.js index 44c571ae3d..6b81b68de9 100644 --- a/packages/@vue/cli-plugin-e2e-cypress/index.js +++ b/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', @@ -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())