I have managed to start debugger, but it looks like VS Code do not see the sourcemap.
When I add debugger JS statement, it breaks in webpack generated file main.js (that do not event exists in file system) but using this is painfull.
I have next setup:
package.json:
"scripts": {
"test:debug": "node --inspect-brk ./node_modules/@vue/cli-service/bin/vue-cli-service.js test:unit"
}
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug unit tests",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"program": "${workspaceFolder}/node_modules/@vue/cli-service/bin/vue-cli-service.js",
"args": [
"test:unit",
"--inspect-brk"
],
"port": 9229
}
]
}
I tried different ways to specify a source maps but nothing helped.
Does anyone have a working setup?
This is what I do and breakpoints work both in TS/JS and inside the unit tests themselves. Using "@vue/cli-service": "^4.1.1" and "@vue/test-utils": "^1.0.0-beta.30".
launch.json
package.json
Add one "debugger" line in your test code to start the inspect and from then on your breakpoints will be hit in vscode. Otherwise add --watch to "test:debug" and then your breakpoints will hit without debugger line like this: