-
Notifications
You must be signed in to change notification settings - Fork 784
Error running istanbul check-coverage --statements 90 #192
Comments
@leore - Is this still an issue for you? I think that it's an easy fix that I can do an submit a PR for if it's still an issue for you or someone else. |
I hit this problem recently. What solutions do you have in mind if you don't mind me asking, @guyellis? |
https://github.com/gotwarlost/istanbul/blob/master/lib/object-utils.js#L59 @chengyin I was going to skip that section of code if Are you hitting this error as well? |
This is most probably because it is trying to process a Json file that doesn't have coverage info. The error message is terrible and doesn't indicate which gold had the problem. If you want to submit a pr, you should probably focus on improving the message and / or skipping files that don't look like a coverage json |
I did some investigation and this is what I got for our specific case: The issue is caused by a mismatch between I dug deeper and in our codebase, this is because we are using webpack inject-loader for our unit tests. If the injected version and the original version both get required, then there are two files registered to the same filename in Istanbul. The extra code for injection threw Istanbul off and eventually caused the exception. Now that’s an issue that Istanbul doesn’t and probably shouldn’t deal with. There are multiple places in Istanbul runs into exceptions because of this. I agree better error message would help. I plan to fork inject-loader and add Istanbul ignore comments for the injection related code. A different inject loader does this. |
@chengyin I agree with @gotwarlost - would be great to also submit a PR for istanbul that did one or more of:
As per my previous "fix" idea my feeling is that istanbul should still try and work and give a partially good result if not complete one while printing out error messages about what it can't do while processing. i.e. given a choice between:
|
Just so it may help others with the same error message, I had the same problem and it was a similar situation as the one reported by @chengyin: the same file with two different coverage information. As we use |
@gotwarlost since this is basically a mistake in the build process and also related to an external library, we should close this for good, don't you think? |
@gotwarlost or create an FAQ from it? |
Getting this error:
/Users/bavidar/.nvm/v0.10.26/lib/node_modules/istanbul/lib/object-utils.js:58
var line = statementMap[st].start.line,
^
TypeError: Cannot read property 'start' of undefined
Has anyone solves this problem?
The text was updated successfully, but these errors were encountered: