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
coverage isn’t working :( #527
Comments
Well that's super weird. Can you share the project where this is happening? Are you using babel or any other source map type transpiling thing? |
Nope, nothing fancy, here’s the project https://github.com/mikeal/ipld-stack I have other projects on the same machine where coverage is working fine. Another odd thing, if I run with |
Ok, I figured it out, this was VERY STRANGE. Basically, I updated my code to not use |
Whoaaaaa, that's so weird. I'll raise this as a nyc issue. Might be a babel thing, but definitely something that should either be supported, or crash loudly, imo. |
Ya, it should definitely fail, but fail loudly ;) If I had to guess, I’d say that someone is assuming that if there is anything they consider a syntax error that the vm is gonna throw up anyway. Little do they know, JS has “reserved words” and “kinda-sorta-reserved words” 🤓 |
Same as this issue, closed for staleness: istanbuljs/nyc#796 |
For what it's worth this would have failed loudly if you had 'use strict';
const interface = 'hello world';
console.log(interface); Running this prints:
I'm not against having nyc print an error when it fails to instrument a source. I'm not confident we can get a specific useful message (I don't want to spam the console, babel errors can be pretty verbose), but at minimum I can definitely say "Error instrumenting filename.js". Another thought |
Coverage appears to be broken and I’m not sure when this happened or why, but I tried both the latest 12x an 13-rc20 versions and I’m getting the same issue.
The .nyc-output directory has two files with empty JSON objects. Any pointers on how to debug this and figure what is going on?
The text was updated successfully, but these errors were encountered: