-
Notifications
You must be signed in to change notification settings - Fork 47
How to skip statements/functions? #24
Comments
Having the same problem. Would be great to allow the same Ignoring Code For Coverage Spec for isparta. |
I'm also experiencing the same issue. @bassettsj, if I'm not mistaken, it's not that isparta needs an "Ignoring Code For Coverage Spec" because it actually uses istanbul behind the scenes. I think this is simply a bug in isparta that somehow istanbul isn't seeing those comment annotations... Is that right @douglasduteil? |
Same here. |
+1 |
@douglasduteil, if you have any idea what the issue might be and where it could potentially be solved and perhaps give some direction on making a PR, I would be happy to contribute a PR. |
+1. This is quite problematic. I'll see if I can contribute a fix for this soon. |
$100 added :-) |
Wow ok. I'll give this a shot today. |
Any progress with this? |
Hum sorry guys but I prefer investing my time in merging with Istanbul #31 |
hmm, is there a way to transfer a bounty to another issue? |
Any news on that. Looks like the merging with Instanbul doesn't go smoothly... |
Another $100 added. I would totally accept this (and prefer it) if the merger with Istanbul is successful. |
Based on the commit history continuing to grow and the last comment on #31 was over 2 months ago, is it safe to assume this issue could still be resolved in the I did some investigating today and it seems like the problem is that |
Fantastic news! I'll award the contributor my bounty when I get a chance to test this out on Monday. This is awesome! |
@kentcdodds Keep me posted on this. |
For an example, compare: Without pragmas: https://coveralls.io/builds/4009011/source?filename=modules%2FRoute.js |
There is (of course) a caveat here - something like |
@TheMcMurder, if you're not doing anything this weekend and want to bump our code coverage big time, you might try upgrading isparta and seeing if this works for us :-) |
Tested it in out project. Works great. |
@taion, please claim the bounty here: https://www.bountysource.com/issues/9221471-how-to-skip-statements-functions I'll then be able to award you the $200 that I've placed on this issue. Thanks! |
Which version of isparta should I use in order to get the /* istanbul ignore next */ working? |
Looks like v3.2.0 or later. |
I ask because I'm using 3.5.3 and it doesn't work. |
Check your transpiled code - this isn't doing anything beyond plumbing everything through. If Babel moves your comment somewhere away from the block you want to ignore, then nothing's going to happen. This is most relevant for something like method declarations in ES6 classes - you'll need to use |
That worked. Thank you very much! |
This function is only called when there is an error (it displays an error dialog on web page). It is not useful to test the coverage of this function.
In Istanbul, you could use
/* istanbul skip next */
, but it doesn't work in Isparta. I also tried/* isparta ignore next */
without success.The text was updated successfully, but these errors were encountered: