-
Notifications
You must be signed in to change notification settings - Fork 787
Support ignore start/ignore end comments #413
Comments
This is hard to do for the general case. Sick people can put start /end comments in a way that spans the AST in weird ways |
I meant "since" not "sick" - damn autocorrect |
@gotwarlost What do you mean? The comments don't need to be attached to the AST at all to work out what lines should be ignored, right? |
@gotwarlost: +1, this would make babel +Istanbul so much better. Although, source maps might fix the babel-Istanbul combo entirely. |
Adds the ability to do `/* istanbul ignore start */` paired with `/* istanbul ignore end */` to ignore ranges of code rather than AST subtrees. Functionally this allows for ignore flags at the same points within the tree and just provides syntax that doesn’t require annotating every AST node with the ignore flags. When the flags partially cover a AST node, the AST is considered NOT skip, but any children that are fully covered will be skipped. Tests for both of these cases are included. Fixes gotwarlost#413
#483 provides a solution to this that accounts for crazy AST coverage and does not alter the existing ignore hint points. |
Just curious, can anyone confirm if this is actually the case? Will source map support in istanbul mean that non-user, babel-generated helper code is ignored when reporting coverage? Meaning that we no longer need auxiliary comments at all? Currently I use As an aside, I'm keenly awaiting source map support (coming in 1.0.0, according to #212), so that I can run coverage reporting on the final output of my build process (the transpiled/minified/concatenated/bundled JS that is ultimately deployed), but have the reports show the original file names/line numbers. I have three
The only reason I have both The reports for I'm hoping that with source map support, I'll be able to drop If source map support also removes the need to use (the now broken) |
@scottohara - take a look at this stupid sample project that shows how to integrate babel and istanbul v1 for node.js https://github.com/istanbuljs/sample-babel-node Key ideas are:
|
Adds the ability to do `/* istanbul ignore start */` paired with `/* istanbul ignore end */` to ignore ranges of code rather than AST subtrees. Functionally this allows for ignore flags at the same points within the tree and just provides syntax that doesn’t require annotating every AST node with the ignore flags. When the flags partially cover a AST node, the AST is considered NOT skip, but any children that are fully covered will be skipped. Tests for both of these cases are included. Fixes gotwarlost#413
We've been having some discussion on babel to add auxiliary comments around the code it generates. See issue babel/babel#2055
This is useful for code coverage tools like those built into the
lab
testing library.I know that istanbul supports ignore next, if, else and was wondering if it could support start/end?
Thanks!
The text was updated successfully, but these errors were encountered: