伊斯坦布尔:使用mocha生成代码覆盖率报告

4
我无法使用Istanbul运行我的Mocha测试生成Cobertura报告。
istanbul report cobertura cover _mocha test
cobertura-coverage.xml 文档中的报告为空。
请注意,如果我不使用报告选项(istanbul cover _mocha test),一切正常,并且我可以在控制台中看到覆盖率摘要。
有任何想法我做错了什么吗?

我实际上将其拆分为两个命令 istanbul cover _mocha test; istanbul report cobertura 使其工作。我不确定是否有更好的方法。 - CarolineBda
3个回答

15

正确的是...

istanbul cover --report cobertura _mocha tests

--report cobertura后添加Cover。


4

对于纽约市而言,它是

nyc --reporter cobertura mocha test

0

你漏掉了 -- 符号:

istanbul cover --report cobertura _mocha test

3
这并不实际有效,据我所知,正确的答案是https://dev59.com/O3vZa4cB1Zd3GeqP-xnx#27287702。 - Goldsmith

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接