Skip to content

Commit 3b6108c

Browse files
author
Darryl Kuhn
committed
feat(service): Allow mocha unit tests debugger to be bound to a specified IP and port
1 parent c8e6450 commit 3b6108c

File tree

1 file changed

+10
-2
lines changed
  • packages/@vue/cli-plugin-unit-mocha

1 file changed

+10
-2
lines changed

packages/@vue/cli-plugin-unit-mocha/index.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,17 @@ module.exports = api => {
3737
`https://sysgears.github.io/mochapack/docs/installation/cli-usage.html`
3838
)
3939
}, (args, rawArgv) => {
40-
const inspectPos = rawArgv.indexOf('--inspect-brk')
40+
const inspectStringPrefix = '--inspect-brk'
41+
const matchedInspectArg = rawArgv.filter((value) => {
42+
return (value.substring(0, inspectStringPrefix.length) === inspectStringPrefix)
43+
})
44+
4145
let nodeArgs = []
42-
if (inspectPos !== -1) {
46+
47+
let inspectArg = ''
48+
if (matchedInspectArg.length !== 0) {
49+
inspectArg = matchedInspectArg[0]
50+
const inspectPos = rawArgv.indexOf(inspectArg)
4351
nodeArgs = rawArgv.splice(inspectPos, inspectPos + 1)
4452
}
4553
// for @vue/babel-preset-app <= v4.0.0-rc.7

0 commit comments

Comments
 (0)