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
fix: Drop unneeded coverage data from nyc --all
#456
Conversation
Frequently users run `nyc --all` in a way that causes source files to be transpiled for actual testing but not transpiled for `--all`. This produces incompatible coverage data and inconsistantly wrong reporting. The work around here is to drop coverage produced by `--all` for any file where we have coverage produced by actual test runs. This ensures that we prefer code that was transpiled in the way which tests actually ran. Fixes #123, #224, #260, #322, #413
See istanbuljs/nyc#1155 for nyc side of this. |
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.
This is clever. we should definitely prefer the real coverage over the files we walked for all
.
It's weird that we end up with incompatible coverage when using --all
, but I can't think of a reason why we ever need to debug this fully?
I believe it's because we merge coverage data before performing source-map remapping. So |
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.
Makes sense to me at a high level... don't know enough of the details to give a more thorough review, sorry!
@coreyfarrell Do you know when this will be released for |
I don't have an exact date but it probably won't take long for a new alpha release of istanbul-lib-coverage. FYI this update will not apply to nyc 14.x. nyc 15.x is still being worked on, for progress on that you can follow istanbuljs/nyc#1104 (no ETA available). |
Frequently users run `nyc --all` in a way that causes source files to be transpiled for actual testing but not transpiled for `--all`. This produces incompatible coverage data and inconsistantly wrong reporting. The work around here is to drop coverage produced by `--all` for any file where we have coverage produced by actual test runs. This ensures that we prefer code that was transpiled in the way which tests actually ran. Fixes istanbuljs#123, istanbuljs#224, istanbuljs#260, istanbuljs#322, istanbuljs#413
Frequently users run
nyc --all
in a way that causes source files to betranspiled for actual testing but not transpiled for
--all
. Thisproduces incompatible coverage data and inconsistantly wrong reporting.
The work around here is to drop coverage produced by
--all
for anyfile where we have coverage produced by actual test runs. This ensures
that we prefer code that was transpiled in the way which tests actually
ran.
Fixes #123, #224, #260, #322, #413