摘要
我最近已经从使用谷歌的JsTestDriver转换为泰斯特姆,但是错过了LCOV HTML代码覆盖率报告,是否有方法将JSCover输出转换为LCOV格式,所以我可以使用genhtml创建这样的报告。
细节
我使用的是一个使用Te梗、Jasmine和PhantomJS的JSCoverage示例,它生成2种覆盖输出格式;
coverage.xml
<report>
<stats>
<packages value="1"/>
<classes value="1"/>
<methods value="1"/>
<srcfiles value="1"/>
<srclines value="3"/>
</stats>
<data>
<all name="all classes">
<coverage type="class, %" value="100% (1/1)"/>
<coverage type="method, %" value="100% (1/1)"/>
<coverage type="block, %" value="100% (1/1)"/>
<coverage type="line, %" value="100% (3/3)"/>
</all>
</data>
</report>jscoverage.json
{
"hello.js": {
"coverage": [null, 1, 1, 1],
"source": ["(function(exports) {", " exports.hello = function(){", " return \"hello world\";", " }", "})(typeof(module) !== \"undefined\" ? module.exports : this);"]
}
}有没有一种方法可以将上述内容包含到jstestdriver.conf-overage.dat格式的js驱动程序输出中?
谢谢。
发布于 2012-12-06 10:27:24
有没有办法将JSCover输出转换成LCOV格式?
是的,见:http://tntim96.github.com/JSCover/manual/manual.xml#reportConversion
总而言之
java -cp JSCover-all.jar jscover.report.Main --format=LCOV REPORT-DIR SRC-DIRECTORYhttps://stackoverflow.com/questions/13722824
复制相似问题