-
Notifications
You must be signed in to change notification settings - Fork 17
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
Allow ignoring lines #27
Comments
That'd be great. One issue is that we're dependent on Esprima to do the parsing, but if I can somehow get the comment attached that parse node, I can probably do it. There have been some new things with Esprima recently. |
I'm working on that.
Example: I think it should ignore the whole function, not just the variable assignment. It's a small change (~ 15 LOC in |
Excellent. I don't really care about the syntax. Ignoring the subtree would be nice. However, that'd make code like
ambiguous, wouldn't it? At least I wouldn't be sure whether that included So, personally, I'd be happy with the line-based solution. However, I imagine a lot of other users would love to ignore whole blocks, so why not implement both? |
The "block-based solution" is in fact a node-based solution. And by node, I mean a node from the syntax tree generated by esprima. When the code encounters a "cover:false", I can say:
@itay what do you think? P.S.: code's coming, I'm preparing a pull request. |
@floriancargoet Great, that works. Thank you very much for implementing it! |
@floriancargoet this is great, I would be happy to merge it in. I'd also be happy to give you commit access if there are other improvements you'd like to do. I would love to have another contributor to help get things going :) |
Here's the pull request. Hope you like it. |
Sometimes, I'm aware that a certain line is not going to be covered (say, because it's related to another platform. For example, when I run my test under node.js, browser-specific branches are not going to be touched).
There should be an option to ignore those lines (so that I can still automatically require 100% coverage). It could look like this:
In the HTML output, the ignored lines could be marked with a light yellow hint.
The text was updated successfully, but these errors were encountered: