用摩卡运行节点检查器

我似乎无法debugging摩卡脚本。

我能够像这个node --inspect script.js检查器运行节点。 这然后给了我一个url去debugging,如chrome-devtools://devtools/remote/...

但是,当我用摩卡这行mocha --inspect test.js我无法debugging。 它说'侦听器在[::]:5858'上侦听。 有没有办法让我使用节点的检查器来debugging摩卡testing?

去localhost:5858给我这个信息:

 Type: connect V8-Version: 5.1.281.84 Protocol-Version: 1 Embedding-Host: node v6.9.1 Content-Length: 0 

使用--inspect --debug-brk没有帮助。

问题是我的摩卡版本。 我运行的是早于3.1.0的版本。 --inspect在3.1.0中增加了对支持的支持

我现在可以用这些行进行debugging了:

 mocha --reporter spec --inspect test.js mocha --reporter spec --inspect --debug-brk test.js 

[DEP0062] DeprecationWarning:不build议使用node --inspect --debug-brk 。 请改用node --inspect-brk

将来使用

 mocha --reporter spec --inspect-brk test.js