You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project where I'm using monocart-reporter to produce a code coverage report. The way my project is configured captures code coverage in V8 and then that is converted to istanbul.
I'm not doing the conversation myself, I use some options on the monocart-reporter that when set use this package v8-to-istanbul to convert the V8 code coverage:
coverage: {toIstanbul: true,lcov: true,
...
},
When I enable these options the code coverage that I get is incorrect. Please see screenshots below for more information. The code coverage screenshots were produced by running with:
babel + istanbul: this shows correct code coverage.
v8 + monocart reporter without the toIstanbul property set which defaults to false: this shows correct code coverage.
v8 + monocart reporter with the toIstanbul property set to true: this shows INCORRECT code coverage.
I hope the instructions provided are enough to replicate the issue and debug it. I'm hoping that by following the instructions to run with v8 + monocart reporter without the toIstanbul property set which defaults to false, you can look at the V8 coverage file and then you would be able to provide that to the v8-to-istanbul package to debug the problem.
Let me know if you need more information.
The text was updated successfully, but these errors were encountered:
Hi,
Bug description
I have a project where I'm using monocart-reporter to produce a code coverage report. The way my project is configured captures code coverage in V8 and then that is converted to
istanbul
.I'm not doing the conversation myself, I use some options on the
monocart-reporter
that when set use this packagev8-to-istanbul
to convert the V8 code coverage:When I enable these options the code coverage that I get is incorrect. Please see screenshots below for more information. The code coverage screenshots were produced by running with:
this shows correct code coverage
.toIstanbul
property set which defaults tofalse
:this shows correct code coverage
.toIstanbul
property set totrue
:this shows INCORRECT code coverage
.babel+istanbul
app/core/ui-services/ui-helper-functions.ts
app/features/find-institution/institutions-list/institutions-list.component.ts
v8 + monocart reporter without the toIstanbul property set which defaults to false
src/app/core/ui-services/ui-helper-functions.ts
src/app/features/find-institution/institutions-list/institutions-list.component.ts
v8 + monocart reporter with the toIstanbul property set to true
app/core/ui-services/ui-helper-functions.ts
app/features/find-institution/institutions-list/institutions-list.component.ts
How to reproduce
npm install
to install all the required packagesTo get the babel+istanbul code coverage:
npm run test-istanbul
. The first time tests will fail because of missing snapshots, you can ignore this.npm run nyc-report
.npm run open-istanbul-coverage
.To get the v8 + monocart reporter without the toIstanbul property set which defaults to false code coverage:
npm run test-monocart
. The first time tests will fail because of missing snapshots, you can ignore this.npm run open-monocart-coverage
.To get the v8 + monocart reporter with the toIstanbul property set to true code coverage:
npm run test-monocart
. The first time tests will fail because of missing snapshots, you can ignore this.npm run open-monocart-coverage
.More notes
To clarify, the problem is that when using
toIstanbul
set to true the code coverage conversion marks some lines as covered when they should not be.I first opened this bug at [BUG] Incorrect code coverage when converting from V8 to istanbul cenfun/monocart-reporter#50. I was told that the
monocart-reporter
package uses this packagev8-to-istanbul
to do the conversion.I hope the instructions provided are enough to replicate the issue and debug it. I'm hoping that by following the instructions to run with v8 + monocart reporter without the toIstanbul property set which defaults to false, you can look at the V8 coverage file and then you would be able to provide that to the
v8-to-istanbul
package to debug the problem.Let me know if you need more information.
The text was updated successfully, but these errors were encountered: