问题描述
我正在使用 Karma-coverage 生成代码覆盖率.我可以在 http-server 上托管我的输出覆盖文件夹并在本地查看它.
I am generating code coverage using Karma-coverage. I can host my output coverage folder on http-server and view it locally.
如何在 VSTS 代码覆盖率选项卡上显示此报告?
How do I make this report visible on VSTS code coverage tab?
我是否需要重新格式化我的覆盖结果以兼容 VSTS?
Do I need to re-format my coverage result in VSTS compatible?
我已经阅读了有关 vsts-tasks 的内容,但我不知道如何实现相同的目标.
I have read about vsts-tasks, but I have no clue how to achieve the same.
感谢任何帮助.
推荐答案
VSTS代码覆盖支持Jacoco 或 Cobertura 格式.Karma-Coverage 支持 Cobertura 格式.为
VSTS Code coverage supports the outputted code coverage results in Jacoco or Cobertura formats. Karma-Coverage supports Cobertura format. Edit your karma.config.js for
因果报应:
coverageReporter: {
type : 'cobertura',
...
}
karma-remap-istanbul:
remapIstanbulReporter: {
reports: {
cobertura: './coverage/cobertura.xml',
...
}
}
remapCoverageReporter: {
cobertura: './coverage/cobertura.xml',
...
},
配置输出格式后,您可以使用发布代码覆盖率任务将代码覆盖率数据上传到 VSTS.
Once you configure the output format, you can use Publish Code Coverage task to upload code coverage data to VSTS.
这篇关于在 VSTS 中包含代码覆盖率报告,VSTS 是否必须使用测试适配器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!