Skip to content

Exclude generated icon file from coverage#16

Open
renefloor wants to merge 1 commit into
westracer:masterfrom
renefloor:patch-1
Open

Exclude generated icon file from coverage#16
renefloor wants to merge 1 commit into
westracer:masterfrom
renefloor:patch-1

Conversation

@renefloor

Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown
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