代码覆盖率是否支持Flutter项目的DART 2? [英] Does Code Coverage support DART 2 for Flutter projects?
本文介绍了代码覆盖率是否支持Flutter项目的DART 2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Flutter Packages官方网站上,写有代码覆盖率插件 dart_codecov_generator (
On the Official Flutter Packages website, it is written that the plugin for Code Coverage, dart_codecov_generator (https://pub.dev/packages/dart_codecov_generator), is DART 2 INCOMPATIBLE. So, is there a way we can use Code Coverage for Flutter projects?
推荐答案
是的,有可能获得Flutter项目的代码覆盖率.
Yes it possible to get the code coverage for a flutter project.
如果运行 flutter test --coverage
,它将在coverage文件夹中输出一个文件(lcov.info),然后可以采用多种解决方案:
if you run flutter test --coverage
, it will output a file (lcov.info) in the coverage folder and then multiple solution are possible:
- 您可以在此文件上使用
genhtml
程序获取覆盖率(您必须进行一些解析) - 使用诸如codecov之类的在线工具将您的代码覆盖范围上传到服务中.
- you can use
genhtml
program on this file to get the coverage (you will have to do some parsing) - use online tool like codecov to upload you code coverage into the service.
这篇关于代码覆盖率是否支持Flutter项目的DART 2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文