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

add start/stop options to branch ignore directives #221

Closed
JeroMiya opened this issue Jul 18, 2014 · 1 comment
Closed

add start/stop options to branch ignore directives #221

JeroMiya opened this issue Jul 18, 2014 · 1 comment

Comments

@JeroMiya
Copy link

From this issue:
#15

This is a good start, but I have a use case where I need to ignore any branches between two directives, not just the 'next' one. This is for internal module definitions where the code always runs, but only once and never during a unit test. In my case, a code-gen tool is generating the nested internal modules and so I don't have a chance to add the directives for each nested module. Here is the output of the tool:

var app;
(function(app) {
  (function(common) {
    common.Foo = (function Foo() { this.foo = 'foo'; } return Foo; }());
   // need an option something like this:
   /* istanbul ignore start */
  })(app.common || (app.common = {}));
})(app || app = {}));
/* istanbul ignore end */

This should result in any code between the start and stop directives not to count towards statement or branch coverage percentages in the report and should be grayed out in the colorized report as in issue 15.

@gotwarlost
Copy link
Owner

Impossible to do this the way istanbul is designed since it looks at the AST and not at the source code. What I have implemented is pretty much what you can get.

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

No branches or pull requests

2 participants