Skip to content

Commit

Permalink
fix(cypress): stop ignoring --config-file cypress option (#5580)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
ahderman committed Jun 21, 2020
1 parent 4891d91 commit 5869f1f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/@vue/cli-plugin-e2e-cypress/index.js
Expand Up @@ -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))
}
Expand Down

0 comments on commit 5869f1f

Please sign in to comment.