-
Notifications
You must be signed in to change notification settings - Fork 11
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
lcov reporter crashes when a js file is changed and rerun during coverage with es2015 and stage-1 presets #14
Comments
I'm seeing the same issue with the The @bcoe Is this an issue with the reporter(s) or are invalid I know in our case, we have the same runtime files loaded on the server and then also in phantomjs after going through a module bundler. We're not using sourcemaps, so I didn't expect things to work, but gave it a try anyways. Initially it looked like things worked and the line hits in all the files that actually produce reports look correct. What's confusing is why most files are fine, but some aren't. |
@mlrawlings are you using |
@jedwards1211 I'm not using This is what the wrapper looks like: $_mod.define(/* FILEPATH */, function(require, module, exports, __filename, __dirname) { /* CODE */
}); I just tested doing coverage for only the files that go through the |
@mlrawlings Okay, well just FYI, if it's possible to use babel, it would probably work for you. I have a project with some modules that get run on the server with |
@mlrawlings basically if you can instrument the code before bundling it, it should work. |
@jedwards1211 I think I have my issues figured out (it was working in some cases because the line numbers were unchanged and only the first line had a character shift), I have another problem where the bundler is picking up a file based on the In your case, I'm curious what you expect to happen. How are you supposed to get accurate coverage of a file that is changing? |
@mlrawlings it's definitely questionable whether it's a valid case to support, though perhaps the reporter could at least do something more reasonable than crashing. On the other hand, it shouldn't be too difficult to merge coverage after adding a new function to a file. But I probably could have tested hot reloading without adding an additional function or otherwise changing the code structure in the file. |
See https://github.com/istanbuljs/nyc/issues/425 for more detail on what actually happens.
For some reason I've only been able to reproduce with
babel-preset-es2015
andbabel-preset-stage-1
active in my.babelrc
.Minimum repro repository: https://github.com/jedwards1211/istanbul-lcov-issue
This is an intermittent issue, possibly just due to ipc timing in this test, which I'm seeing about 80% of the time, so rerun
npm test
a few times if you don't see it.Here's what the bug occuring looks like:
The text was updated successfully, but these errors were encountered: