-
Notifications
You must be signed in to change notification settings - Fork 42
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
Ability to mark certain parts of code as covered in order to achieve 100% coverage. #63
Comments
Hey @ZeusTheTrueGod, marking unsafe sections of code is a really interesting idea. I can remember similar situations that I've encountered where I know some statements are wonky and that flow doesn't like it, but I just want to make it shut up so I can continue. I'm not sure modifying this tool is the right place to make that happen though. Let me explain why. Like you noted, currently flow-coverage-report calls out to the flow binary to get the coverage data with So I'm thinking, this should probably be reported and implemented directly in facebook/flow, so all downstream tools, like flow-coverage-report and Nuclide benefit. In the mean time, I have some workarounds to suggest!
|
@ryan953 I had similar thoughts, thanks for providing the proper answer. |
@ZeusTheTrueGod Yeah, I totally agree with @ryan953, this feature would be very nice (maybe also paired with an eslint rule that prevent has to abuse of it :-)), but it would be better if flow is the place where the marked expressions are filtered out, and in the meantime the using the also, I would be more than happy to add some documentation about such wrapper once we have figured out the details 👍 |
First of all, this looks like a great tool. I still find that, for example, when I call
const result: MyType = await response.json()
on an isomorhic-fetch I get that part of code uncovered, whatever I do. The other place is a default(action: empty)
guard in a react-redux reducer which is also reported as an uncovered code.I want to try to get a 100% coverage, if that is possible at all, and thus would like to mark "unsafe" places somehow, the first idea is to analyze the generated json file, extract "uncovered_locs" together with a source code for those chunks and get rid of those pieces of code which I explicitly specify. The other option would be to somehow annotate those places directly, although no ideas how, may be with a special comment like
const result: MyType = /*UnsafeStart*/ response.json() /*UnsafeEnd*/
The text was updated successfully, but these errors were encountered: