-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
we should still run transpilers on source files included via --all #143
Conversation
… might be registered
That works in my repro example and a real project. Thanks! 👏 |
@@ -158,8 +158,9 @@ NYC.prototype._prepGlobPatterns = function (patterns) { | |||
|
|||
NYC.prototype.addFile = function (filename) { | |||
var relFile = path.relative(this.cwd, filename) | |||
var source = stripBom(fs.readFileSync(filename, 'utf8')) | |||
var source = this._readTranspiledSource(path.resolve(this.cwd, filename)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My only thought would be to do this conditionally if we don't already have coverage data on that particular file. This feels like a performance hit.
Looks good. Only thing I can think of is maybe to gitignore |
we should still run transpilers on source files included via --all
@albertogasparin @jwhitfieldseed could you give the
|
Not there yet. Now I got a different error:
This is the project I'm testing it on: https://github.com/albertogasparin/react-starterkit/tree/nyc-coverage |
By looking at the source code, I've also tried adding |
@bcoe |
I've reproduced @albertogasparin's problem (don't forget to install
Seems like an Istanbul bug to me so perhaps @albertogasparin you could report it upstream?. Meanwhile I did some hacks to normalize the positions, see this branch: https://github.com/novemberborn/nyc/tree/clamp-positions. @bcoe do you think this is something we should fix on our end? I can turn that branch into a PR with some tests. |
Thanks for pointing out the |
Applying the source map to the report that was created by Istanbul is what fails. |
@novemberborn great debugging; I would definitely be interested in patching this on our end, but I think we should also open an issue with Istanbul, and be prepared to pull our code out (mind doing this). @novemberborn want to open a pull request with your patch, and we can see if it fixes @albertogasparin's problem? |
I've tried reproducing the issue with @albertogasparin's code by transpiling the |
@albertogasparin @novemberborn give this a try:
If things are looking good, I'd like to promote |
Tested On a side note, it is interesting that, given the same source, I get two slightly different reports: All files | 42.03 | 36.21 | 30.19 | 41.61 # retainLines: true
All files | 43.55 | 42.59 | 26.83 | 42.37 # retainLines: false But I assume this is expected as the instrumented code is different. |
Given the illegal coverage positions returned by Istanbul we may not be able to map coverage to the correct source lines, hence the difference. But coverage is pretty far from 100% it seems, so relatively speaking it's not much of a concern. Would be interesting to see if the underlying error stops you from hitting 100%. |
Well, it looks like that by approaching 100% coverage the difference disappears. Files with 100% coverage are 100% regardless of the flag, so it is a non issue unless you care about 81% vs 82% 😉 |
regarding
Don't know if this is really worth pursuing anyway; I had it on to assist WebStorm with debugging. |
@boneskull I wonder if the source map is less accurate when |
@jwhitfieldseed could you give this branch a shot and let me know if it does the trick for you?
Reviewers: @jamestalmage @novemberborn