From 5869f1f2d107078d0e493fdad8bb8219c2a1a910 Mon Sep 17 00:00:00 2001 From: Alexandre D'Erman Date: Sun, 21 Jun 2020 11:12:10 +0200 Subject: [PATCH] fix(cypress): stop ignoring --config-file cypress option (#5580) This fixes an issue with the implementation of `removeArg()` whereby calling `removeArg(args, "config")` removed argument "--config-file" if provided This commit fixes this by ensuring that calling `removeArg(args, "config")` removes `--config` without removing `--config-file`. --- packages/@vue/cli-plugin-e2e-cypress/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/@vue/cli-plugin-e2e-cypress/index.js b/packages/@vue/cli-plugin-e2e-cypress/index.js index f567262a36..44c571ae3d 100644 --- a/packages/@vue/cli-plugin-e2e-cypress/index.js +++ b/packages/@vue/cli-plugin-e2e-cypress/index.js @@ -53,9 +53,10 @@ module.exports.defaultModes = { } function removeArg (rawArgs, argToRemove, offset = 1) { - const matchRE = new RegExp(`^--${argToRemove}`) + const matchRE = new RegExp(`^--${argToRemove}$`) const equalRE = new RegExp(`^--${argToRemove}=`) - const i = rawArgs.findIndex(arg => matchRE.test(arg)) + + const i = rawArgs.findIndex(arg => matchRE.test(arg) || equalRE.test(arg)) if (i > -1) { rawArgs.splice(i, offset + (equalRE.test(rawArgs[i]) ? 0 : 1)) }