Ember CLI和代码覆盖率 [英] Ember CLI and code coverage
问题描述
有人设法使代码覆盖范围与Ember CLI项目一起工作吗?
Has anyone managed to get code coverage working with an Ember CLI project?
我尝试使用 blanket.js 和 istanbul ,以及其他< a href = https://stackoverflow.com/questions/24498486/blanket-js-not-working-with-qunit-in-ember-cli>此处,此处和此处,均未成功。我设法让每个人都实际生成覆盖率报告,但是该报告显示0%(伊斯坦布尔)或100%(blanket.js),并且当前的测试无法提供100%的覆盖率。
I've tried using blanket.js and istanbul, as have others here, here and here, neither with any success. I've managed to get each to actually produce a coverage report but the report either says 0% (istanbul) or 100% (blanket.js), and there's no way the current tests provide 100% coverage.
Ember CLI生成的内置项目JavaScript文件包含项目的所有源文件,每个文件的内容输出到一行上,有时甚至很大。因此,即使覆盖率工具能够为构建文件中的代码生成实际的覆盖率指标,也存在查看结果的问题。上帝只知道您如何将其链接回原始源文件吗?
The built project JavaScript file that Ember CLI produces contains all of the project's source files with each file's contents being output onto one, sometimes massive, line. So even if the coverage tool was able to produce the actual coverage metrics for the code in the built file there's then the issue of viewing the results. God only knows how you would link this back to the original source files?
Ember CLI非常棒,而且似乎很流行,所以令我惊讶的是,更多的人还没有这个问题。也许其他人并没有被代码覆盖所困扰,或者大多数人只是让它正常工作而没有问题,而我却缺少了一些东西。
Ember CLI is great and seems popular so I'm surprised more people haven’t had this issue. Perhaps others aren't as bothered by code coverage or maybe most just get it working without issue and I'm missing something.
推荐答案
AFAIK, ember-cli-code-coverage 提供了最准确,最容易的方法配置ember-cli应用程序的覆盖率解决方案。它为 app /
目录中的每个文件创建可读的覆盖率报告。它基于 istanbul 。
AFAIK, ember-cli-code-coverage provides the most accurate and easy to configure solution for coverage in ember-cli applications.It creates readable coverage reports for each file in the app/
directory. It is based on istanbul.
这篇关于Ember CLI和代码覆盖率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!