我在我的摩卡测试中使用了Babel.要在终端中运行测试,请使用以下命令:
mocha --debug --compilers js:babel/register
Run Code Online (Sandbox Code Playgroud)
然后我可以使用VS Code"Attach"调试选项来附加到测试过程.我可以设置断点并停止,但因为原始代码在ES6 VS代码中对行号等感到困惑.
反正有没有让VS Code与这个设置一起工作?
我的"附加"配置:
{
"name": "Attach",
"type": "node",
// TCP/IP address. Default is "localhost".
"address": "localhost",
// Port to attach to.
"port": 5858,
"sourceMaps": false
}
Run Code Online (Sandbox Code Playgroud)
"sourceMaps": true 没有任何区别
我正在尝试运行测试的项目是开源的.GitHub回购:https://github.com/mohsen1/yawn-yaml/