本文介绍了代码覆盖率失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我设置了使用grunt 生成代码覆盖率报告的项目构建。这是以cobertura格式生成的。
我还尝试通过内置支持启用代码覆盖。这不起作用。我得到以下
2017-02-10T20:56:47.2764651Z HELPDESKAPP @ D:\\\\\\
2017-02- 10T20:56:47.2764651Z + - UNMET PEER DEPENDENCY [email protected]
2017-02-10T20:56:47.2764651Z` - [email protected]
2017-02-10T20:56 :47.2764651Z
2017-02-10T20:56:47.2794656Z npm WARN [email protected]需要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
问题 -
如何设置构建以便它只是读取报告文件?而不是试图破坏他的代码覆盖率
或
如何在生成代码覆盖率时修复上述错误?
解决方案
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 [email protected] 2017-02-10T20:56:47.2764651Z `-- [email protected] 2017-02-10T20:56:47.2764651Z 2017-02-10T20:56:47.2794656Z npm WARN [email protected] 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?
解决方案
这篇关于代码覆盖率失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!