【发布时间】:2015-10-09 19:55:25
【问题描述】:
我在 Mocha 测试中使用 Babel。要在终端中运行测试,我使用以下命令:
mocha --debug --compilers js:babel/register
然后我可以使用 VS Code“附加”调试选项附加到测试过程。我可以设置断点并停止,但是因为原始代码在 ES6 中,VS Code 对行号等感到困惑。
有没有办法让 VS Code 使用这个设置?
我的“附加”配置:
{
"name": "Attach",
"type": "node",
// TCP/IP address. Default is "localhost".
"address": "localhost",
// Port to attach to.
"port": 5858,
"sourceMaps": false
}
"sourceMaps": true 没有任何区别
我正在尝试运行测试的项目是开源。 GitHub 仓库:https://github.com/mohsen1/yawn-yaml/
【问题讨论】:
标签: testing mocha.js babeljs visual-studio-code