Search code examples
javascriptnode.jsmocha.jswebstorm

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.

What I am trying to do is this:

  • Use WebStorm for running tests
  • use Mocha (and co-mocha) as a testing framework
  • Use yield and generators for making my test code more readable
  • 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)

The first two points are going fine, the third one is tripping me up.


Solution

  • Unfortunately WebStorm doesn't provide coverage support for Mocha:( Please follow WEB-10373 for updates