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

How to report coverage only on files marked with "// @flow"? #85

Open
moroshko opened this issue May 20, 2017 · 1 comment
Open

How to report coverage only on files marked with "// @flow"? #85

moroshko opened this issue May 20, 2017 · 1 comment

Comments

@moroshko
Copy link

I started to add flow annotations to my project by adding // @flow to certain files.
I would like to make sure that those files are passing a certain flow coverage threshold.

At the moment, it looks like the files included in the coverage report are based on -i (and -x).
This causing the covered percent to be very low.

Is it possible to report coverage only on files marked with // @flow?

@rpl
Copy link
Owner

rpl commented May 29, 2017

@moroshko not yet, but it is definitely a good idea.

It is definitely possible to introduce this feature by using the "flow-annotation-check" npm dependency to discover if a file has the flow annotation and automatically add/remove the file from the report accordingly.

dmnd added a commit to dmnd/flow-coverage-report that referenced this issue Jul 10, 2017
When calculating coverage for a project, I don't care about coverage in
files that don't have the `@flow` pragma. While it's nice that Flow
infers types anyway, since it's never going to report an error it
doesn't help me at all and is potentially misleading. For example, my
project is 75% covered with master, but only 34% covered with this
change.

This PR changes flow-coverage-report to ignore coverage in unannotated
files. This could be considered a breaking change or a bugfix - I'm not
sure. You might consider making this a configuration option.

Resolves rpl#85
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants