From f1fee63ab99a1eeaeb4b2c82122c1f1ba725f3cc Mon Sep 17 00:00:00 2001 From: Darryl Kuhn Date: Thu, 19 Mar 2020 23:44:24 +0000 Subject: [PATCH] feat(service): Allow mocha unit tests debugger to be bound to a specified IP and port --- packages/@vue/cli-plugin-unit-mocha/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@vue/cli-plugin-unit-mocha/index.js b/packages/@vue/cli-plugin-unit-mocha/index.js index 2fd61f9a12..f41ea0fffa 100644 --- a/packages/@vue/cli-plugin-unit-mocha/index.js +++ b/packages/@vue/cli-plugin-unit-mocha/index.js @@ -37,8 +37,9 @@ module.exports = api => { `https://sysgears.github.io/mochapack/docs/installation/cli-usage.html` ) }, (args, rawArgv) => { - const inspectPos = rawArgv.indexOf('--inspect-brk') let nodeArgs = [] + + const inspectPos = rawArgv.findIndex(arg => arg.startsWith('--inspect-brk')) if (inspectPos !== -1) { nodeArgs = rawArgv.splice(inspectPos, inspectPos + 1) }