Skip to content

Commit

Permalink
feat(service): Allow mocha unit tests debugger to be bound to a speci…
Browse files Browse the repository at this point in the history
…fied IP and port
  • Loading branch information
Darryl Kuhn committed Mar 19, 2020
1 parent c8e6450 commit 3b6108c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/@vue/cli-plugin-unit-mocha/index.js
Expand Up @@ -37,9 +37,17 @@ module.exports = api => {
`https://sysgears.github.io/mochapack/docs/installation/cli-usage.html`
)
}, (args, rawArgv) => {
const inspectPos = rawArgv.indexOf('--inspect-brk')
const inspectStringPrefix = '--inspect-brk'
const matchedInspectArg = rawArgv.filter((value) => {
return (value.substring(0, inspectStringPrefix.length) === inspectStringPrefix)
})

let nodeArgs = []
if (inspectPos !== -1) {

let inspectArg = ''
if (matchedInspectArg.length !== 0) {
inspectArg = matchedInspectArg[0]
const inspectPos = rawArgv.indexOf(inspectArg)
nodeArgs = rawArgv.splice(inspectPos, inspectPos + 1)
}
// for @vue/babel-preset-app <= v4.0.0-rc.7
Expand Down

0 comments on commit 3b6108c

Please sign in to comment.