Open samhatoum opened 1 year ago
You can't mix Istanbul instrumented coverage with V8 coverage. Use the same instrumenter for both test setups.
E.g. change 'babel'
here to use istanbul with Jest: https://github.com/samhatoum/monorepro/blob/c6203edacde44b93eb5a48cf09feaea9b408ade0/jest.config.ts#L6
Thank you, that's definitely improved it, but the branches now show as 50% combined coverage.
I've updated the repo
@samhatoum - were you able to resolve it ? I am having the same issue with nyc 15.1.0 , Node 18.17.0 and mocha 10.2.0 version
No, just learned to live with it and reduce the thresholds. I'd love to see it fixed
EDIT: this issue as partly fixed by using babel instead of v8 in Jest, however the branches still do not add up to 100% despite the single report from Jest does show 100% branch coverage. More in the thread.
Link to bug demonstration repository
https://github.com/samhatoum/monorepro/tree/nyc (note the
nyc
branch`)Expected Behavior
Combined coverage from two test runs should add up 100% when one of the input coverage reports has 100% coverage
Observed Behavior
Combined coverage is reduced when the second test run contains less than 100% test coverage
Here's the report from Jest
Here's the report from Cucumber:
Here's the combined report:
.nycrc.json
package.json
scripts that produce the aboveTroubleshooting steps
cache: false
in my nyc configEnvironment Information