Search code examples
javascriptcode-coveragemocha.jsistanbul

Istanbul: generate code cobertura report with mocha


I can't generate a cobertura report with Istanbul running my mocha tests.

istanbul report cobertura cover _mocha test

The report in cobertura-coverage.xml is empty.

Note that if I run without report option (istanbul cover _mocha test) everything works fine and I can see in the console the coverage summary.

Any ideas what I'm doing wrong?


Solution

  • You're missing the --:

    istanbul cover --report cobertura _mocha test