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

Exclude generated icon file from coverage #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renefloor
Copy link

This generated file is part of a (Flutter) project. However, the private constructor can't be tested. So projects using this can't aim for 100% coverage. With this line you can ignore this complete file from the test coverage.
We could also use

// coverage:ignore-line to ignore one line.
// coverage:ignore-start and // coverage:ignore-end to ignore range of lines inclusive.

@Cteq3132
Copy link

Hello,
I ran into the same problem and found a better solution I think :
Instead of ignoring coverage with the line // coverage:ignore:file, you can use a custom output class file with the option fortify ... --output-class-file=.../icons.g.dart to mark it as generated and then remove those .g files from coverage with remove_from_coverage package : remove_from_coverage -r '\.g\.dart'

@renefloor
Copy link
Author

I totally agree. Would be nice to update the readme to show that in the example config: https://github.com/westracer/fontify#cli-tool-config-file

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.

2 participants