如何使Istanbul生成我所有源代码的覆盖范围? [英] How to make Istanbul generate coverage for all of my source code?

查看:91
本文介绍了如何使Istanbul生成我所有源代码的覆盖范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,伊斯坦布尔只为测试中使用的文件生成覆盖率,这是可以的,但似乎无法达到覆盖率的目的.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆