Visual Studio 团队服务代码覆盖率发布剥离样式表是否有变通办法

Is there a work around for Visual Studio team services code coverage publishing stripping style sheets

我们使用 karma 生成的代码覆盖率报告。我认为这不相关,但我们也 运行 通过伊斯坦布尔的覆盖范围将覆盖范围映射回 TypeScript。此前,这些结果由 Visual Studio 团队服务发布为构建 运行 的覆盖率报告。在构建报告的代码覆盖部分,这些报告曾经完美地显示。

2016 年 9 月 6 日左右,该报告在构建中的显示开始从网站框架中显示的报告中剥离样式表标签。下载报告并在浏览器中查看它会显示原始报告中的正确样式表标记。

有没有使用团队服务这个功能的人注意到这个变化?你有办法解决这个问题吗?样式报告使它们成为非常有用的颜色编码覆盖率结果。

我在团队服务用户语音中问过这个问题,但没有看到 activity:https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/15926806-code-coverage-report-on-build-should-not-strip-sty

由于安全问题,此功能已被收回。详情请参考这个link:Code coverage became delete link and meta tags.

We’re sorry we’ve caused you pain. We realise this appears to be a takeback. We took this step because discovered a vulnerability and had to take immediate action for your security before any public disclosure. The current state is a stopgap and we are investigating the right, secure way to restore the user experience. We will share more about this in a blog post shortly.

Note: you can still use the "Download Coverage Results" link to download the html files and browse locally.

是的,有实现样式(外观和感觉)的变通方法。生成覆盖率报告后,您可以触发 Gulp、Grunt 或节点任务等,读取外部 CSS 并在实际报告中写入标签 HTML.

不同的文章提到了不同的实现方式。您可以查看此处列出的那些 -> code coverage html reports are missing styles in VSTS

Link 到我为解决这个特定问题而创建的 NPM 包 https://www.npmjs.com/package/vsts-coverage-styles