简体   繁体   English

伊斯坦布尔报道+摩卡+ teamcity记者

[英]Istanbul coverage + mocha + teamcity reporter

I would like to run tests with istanbul coverage on TeamCity and report test results back to the Tests tab. 我想在TeamCity上运行伊斯坦布尔覆盖的测试,并将测试结果报告回“测试”选项卡。 I run the following command: 我运行以下命令:

node --harmony C:\...\node_modules\istanbul\lib\cli.js cover C:\...\node_modules\mocha\bin\_mocha --reporter mocha-teamcity-reporter  --require C:\...\tests_setup.js C:\...\test\**\*Test.js && node --harmony C:\...\istanbul\lib\cli.js report teamcity 

I see coverage results in my tab Code Coverage, but tests are not shown in the tab Tests. 我在“代码覆盖率”选项卡中看到覆盖率结果,但是“测试”选项卡中未显示测试。 I have the following error in my logs: 我的日志中出现以下错误:

 >> Warning: Could not find any test files matching pattern: mocha-teamcity-reporter

What could be wrong ? 有什么问题吗? Is it possible to run istanbul coverage for mocha tests and report test results back to the teamcity for the tab Tests ? 是否可以运行伊斯坦布尔覆盖范围的摩卡测试,并将测试结果报告给Teamcity以使用“测试”选项卡?

Thanks for your help! 谢谢你的帮助!

The parameters are not being passed to mocha. 参数未传递给摩卡。

https://github.com/gotwarlost/istanbul#the-cover-command https://github.com/gotwarlost/istanbul#the-cover-command

You need to add -- to pass parameters to the covered command 您需要添加--才能将参数传递给涵盖的命令

node --harmony C:\...\node_modules\istanbul\lib\cli.js cover \
    C:\...\node_modules\mocha\bin\_mocha -- \
    --reporter mocha-teamcity-reporter \
    --require C:\...\tests_setup.js C:\...\test\**\*Test.js

or without global paths 或没有全局路径

istanbul cover mocha -- --reporter mocha-teamcity-reporter --require tests_setup.js test/**/*Test.js

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 茶匙+摩卡咖啡+伊斯坦布尔覆盖 - Teaspoon + Mocha + Istanbul Coverage 伊斯坦布尔代码覆盖Mocha测试 - Istanbul code coverage for Mocha tests 如何从Code Coverage Istanbul Reporter中排除模拟文件 - How to exclude mock files from Code Coverage Istanbul Reporter 在 jest-html-reporter/Istanbul 中启用 Jest 测试的代码覆盖率 - Enable code coverage for Jest tests in jest-html-reporter/Istanbul Enzyme 和 Mocha 在伊斯坦布尔覆盖测试中给我错误,为什么? - Enzyme and Mocha gives me error for a Istanbul coverage test, why? 可以通过TeamCity发布JavaScript覆盖工具伊斯坦布尔的输出吗? - Can output from JavaScript coverage tool Istanbul be published through TeamCity? 如何使用正则表达式从istanbul text-summary报告器中提取测试覆盖率? - How do I extract test coverage from the istanbul text-summary reporter with a regex? 带有Mocha测试用例的Istanbul覆盖率仅显示规格文件(测试文件)的覆盖率报告 - Istanbul coverage with mocha test cases only showing coverage report for spec files (test files) Sourcemap + istanbul / isparta代码覆盖率为webpack + babel(对于es6)+ mocha(+ karma) - Sourcemap + istanbul/isparta code coverage for a webpack + babel (for es6) + mocha (+karma) 伊斯坦布尔 + 代码覆盖 + 摩卡咖啡 - Istanbul + codecoverage + mocha
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM