VScode调试mocha
lanch.json配置文件
"configurations": [{
"type": "node",
"request": "launch",
"name": "Run mocha",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"args": [
//要测试的的文件
"test/test.js",
"--no-timeouts"
],
"cwd": "${workspaceFolder}",
"runtimeExecutable": null,
"env": {
"NODE_ENV": "testing"
}
}]
打断点,按f5就可以调试啦