如何使Istanbul生成我所有源代码的覆盖范围? [英] How to make Istanbul generate coverage for all of my source code?
问题描述
目前,伊斯坦布尔只为测试中使用的文件生成覆盖率,这是可以的,但似乎无法达到覆盖率的目的.
Currently Istanbul is only generating coverage for files that are used in my tests, which is okay, but seems to defeat the purpose of having coverage somewhat.
我没有Istanbul配置,正在使用以下脚本字符串通过npm test
调用它:
I have no Istanbul configuration, and am invoking it via npm test
with the following script string:
$ istanbul cover _mocha -- -R dot --check-leaks --recursive test/
有没有一种方法可以覆盖我所有的源代码?
Is there a way to generate coverage for all of my source code?
推荐答案
找到了答案,我认为我很幸运,因为我选择的目录结构允许我使用此选项,但是现在我的测试命令是:
Found the answer, I think I'm partly lucky that the directory structure I have chosen allows me to use this option, but my test command is now:
$ istanbul --include-all-sources cover _mocha -- -R dot --recursive test/
--include-all-sources
是重要的部分.
这篇关于如何使Istanbul生成我所有源代码的覆盖范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!