Does Code Coverage support DART 2 for Flutter projects?

家住魔仙堡 提交于 2021-01-29 13:10:59

问题


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?


回答1:


Yes it possible to get the code coverage for a flutter project.

if you run flutter test --coverage, it will output a file (lcov.info) in the coverage folder and then multiple solution are possible:

  • 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.


来源:https://stackoverflow.com/questions/57676707/does-code-coverage-support-dart-2-for-flutter-projects

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!