【发布时间】:2015-08-24 22:31:43
【问题描述】:
在为 Node.js 开发使用 WebStorm 10 时,我无法在调试时逐步完成测试用例(用 ES6 编写)。我猜转编译使测试文件不同步。想知道有没有人调试成功?
这是我的 test.js 文件
describe('TestFlow', function () {
"use strict";
it('Test Path', (done) => {
console.log("Testing_1 happy path\n");
console.log("Testing_2 happy path\n");
done();
});
});
我将 Mocha 选项配置为使用 --compilers js:babel/register。现在,当我尝试调试代码时,单步执行过程是不可预测的,它只是不起作用。 babel 编译搞乱了调试过程。
能否请您告诉我是否有解决此问题的方法?我认为调试 ES6 代码是 WebStrom 10 中的一个功能,但我没有运气
【问题讨论】:
-
是的,我遇到了同样的问题。您应该使用 JetBrains 开一张票。
标签: node.js mocha.js webstorm ecmascript-6