简体   繁体   English

将代码覆盖率添加到WebStorm中的异步node.js mocha测试

[英]Adding code coverage to async node.js mocha tests in WebStorm

I am trying to set up code coverage for my node.js unit tests. 我正在尝试为我的node.js单元测试设置代码覆盖率。

What I am trying to do is this: 我想要做的是这样的:

  • Use WebStorm for running tests 使用WebStorm运行测试
  • use Mocha (and co-mocha) as a testing framework 使用Mocha(和co-mocha)作为测试框架
  • Use yield and generators for making my test code more readable 使用yield和generator使我的测试代码更具可读性
  • See the code coverage of my source code via the WebStorm UI (hoping to see my source code files color-coded according to code coverage) 通过WebStorm UI查看源代码的代码覆盖率(希望根据代码覆盖率查看我的源代码文件的颜色编码)

The first two points are going fine, the third one is tripping me up. 前两点都很顺利,第三点是绊倒我。

不幸的是,WebStorm不为Mocha提供覆盖支持:(请按照WEB-10373进行更新

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM