代码覆盖率失败 [英] Code Coverage fails

查看:168
本文介绍了代码覆盖率失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我设置了使用grunt 生成代码覆盖率报告的项目构建。这是以cobertura格式生成的。


我还尝试通过内置支持启用代码覆盖。这不起作用。我得到以下

 2017-02-10T20:56:47.2764651Z HELPDESKAPP @ D:\\\\\\ 
2017-02- 10T20:56:47.2764651Z + - UNMET PEER DEPENDENCY grunt@0.4.5
2017-02-10T20:56:47.2764651Z` - istanbul@0.4.5
2017-02-10T20:56 :47.2764651Z
2017-02-10T20:56:47.2794656Z npm WARN grunt-bump@0.8.0需要grunt @> = 1.0.1的同伴,但没有安装。
2017-02-10T20:56:47.3114656Z [command] C:\Program Files\\\
odejs\\\
ode.exe ./node_modules/istanbul/lib/cli.js cover --report cobertura --report html -i。\app\scripts\ ** \ * .js ./node_modules/jasmine/bin/jasmine.js JASMINE_CONFIG_PATH = node_modules / jasmine / lib / examples / jasmine.json test / spec / ** / * .js
2017-02-10T20:56:47.8205072Z无法解析文件[./node_modules/jasmine/bin/jasmine.js]
2017-02-10T20:56:47.8205072Z尝试" ;伊斯坦布尔帮助" for use
2017-02-10T20:56:47.8384634Z阅读"D:\\\\\\\coverage \cobertura-coverage.xml"的代码覆盖率摘要
2017- 02-10T20:56:47.9514654Z ## [错误]伊斯坦布尔失败并出现错误:C:\Program Files \\\
odejs\\\
ode.exe失败,返回码:1




问题 -


如何设置构建以便它只是读取报告文件?而不是试图破坏他的代码覆盖率





如何在生成代码覆盖率时修复上述错误?


解决方案

您好huskercane,


感谢您在此发布。


在Grunt步骤之前,您需要使用" npm " ;步骤安装项目所需的一些js包。这取决于您使用的框架。 例如,"npm install --save-dev jasmine" Jasmine总是需要


最好的问候


Hello,

I setup my project build that uses grunt to generate code coverage report. This is generated in cobertura format.

I also tried enabling code coverage through builtin support. This does not work. I get following

2017-02-10T20:56:47.2764651Z HELPDESKAPP@ D:\a\1\s
2017-02-10T20:56:47.2764651Z +-- UNMET PEER DEPENDENCY grunt@0.4.5
2017-02-10T20:56:47.2764651Z `-- istanbul@0.4.5 
2017-02-10T20:56:47.2764651Z 
2017-02-10T20:56:47.2794656Z npm WARN grunt-bump@0.8.0 requires a peer of grunt@>=1.0.1 but none was installed.
2017-02-10T20:56:47.3114656Z [command]C:\Program Files\nodejs\node.exe ./node_modules/istanbul/lib/cli.js cover --report cobertura --report html -i .\app\scripts\**\*.js ./node_modules/jasmine/bin/jasmine.js JASMINE_CONFIG_PATH=node_modules/jasmine/lib/examples/jasmine.json test/spec/**/*.js
2017-02-10T20:56:47.8205072Z Unable to resolve file [./node_modules/jasmine/bin/jasmine.js]
2017-02-10T20:56:47.8205072Z Try "istanbul help" for usage
2017-02-10T20:56:47.8384634Z Reading code coverage summary from 'D:\a\1\s\coverage\cobertura-coverage.xml'
2017-02-10T20:56:47.9514654Z ##[error]Istanbul failed with error: C:\Program Files\nodejs\node.exe failed with return code: 1


Question -

How can I setup build so it just reads the report file? and not try to runt he code coverage

or

How do I fix above error while generating code coverage?

解决方案

Hi huskercane,

Thank you for posting here.

Before the Grunt step, you need to use "npm" step to install some js packages that your project needs. This depends on which frameworks you use.  For example, the "npm install --save-dev jasmine" is always needed for Jasmine.

Best regards


这篇关于代码覆盖率失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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