Skip to content

Commit 5869f1f

Browse files
authored
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`.
1 parent 4891d91 commit 5869f1f

File tree

1 file changed

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

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ module.exports.defaultModes = {
5353
}
5454

5555
function removeArg (rawArgs, argToRemove, offset = 1) {
56-
const matchRE = new RegExp(`^--${argToRemove}`)
56+
const matchRE = new RegExp(`^--${argToRemove}$`)
5757
const equalRE = new RegExp(`^--${argToRemove}=`)
58-
const i = rawArgs.findIndex(arg => matchRE.test(arg))
58+
59+
const i = rawArgs.findIndex(arg => matchRE.test(arg) || equalRE.test(arg))
5960
if (i > -1) {
6061
rawArgs.splice(i, offset + (equalRE.test(rawArgs[i]) ? 0 : 1))
6162
}

0 commit comments

Comments
 (0)