Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lesson 23: Collecting code coverage from your tests #23

Merged
merged 1 commit into from
Dec 2, 2020
Merged

Conversation

samuelematias
Copy link
Owner

Description

PR with Lesson 23.

How to install LCOV on:

To generate de coverage report:

flutter test --coverage

Now, check your root project, and you will see a new folder with the name coverage, and inside this folder a file with the name lcov.info.

Screen Shot 2020-12-02 at 18 28 36

If you open this file, will see something like that, hard to understand:

Screen Shot 2020-12-02 at 18 29 31

Then, after install the LCOV, run this command:

genhtml ./coverage/lcov.info -o coverage

And will be generated this, inside the coverage folder:

Screen Shot 2020-12-02 at 18 31 31

Now, let's check the real coverage report, running this command:

open coverage/index.html

And an HTML page will open in your browser:

Screen Shot 2020-12-02 at 18 34 35

Screen Shot 2020-12-02 at 18 35 14

Now, if you check one of these files, you’ll see that you don’t have 100% test coverage. If you open one of these files, you will see a red line in some part of your code, and that red line my friend (probably) is the part that remains to be tested to reach approximately or 100% test coverage in that file.

Screen Shot 2020-12-02 at 18 37 26

Types of changes

  • Fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change which adds Improvements)

@samuelematias samuelematias merged commit ec134eb into main Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant