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 tried inject-loader with Typescript and Istanbul coverage.
For the code:
import getFoo from 'getFoo';
The inject-loader adds a logical or-expression. The result looks like:
var getFoo_1 = __getInjection("getFoo") || __webpack_require__(2);
If the depedency is mocked in all tests and the actual module is never used, the right side of the or-expression is never executed. This results in an uncovered branch in the coverage report.
The text was updated successfully, but these errors were encountered:
@mixer2 Hey there — yep, working around Istanbul (coverage in general) is pretty tricky. It’s something I’d love to support but have been unable to find the time to explore how (and if) it can be done. Sorry for the inconvenience.
plasticine
changed the title
Wrong branch coverage
Support code-coverage instrumentation
Apr 7, 2018
importsomethingInjectorfrom'inject-loader!./something';describe('something',()=>{it('should do something',()=>{constiSomething=somethingInjector('./something': ()=>console.log('mocked'),).default;iSomething();})});
The issue is that coverage report shows that original doSomething() function is completely uncovered.
I tried inject-loader with Typescript and Istanbul coverage.
For the code:
The inject-loader adds a logical or-expression. The result looks like:
If the depedency is mocked in all tests and the actual module is never used, the right side of the or-expression is never executed. This results in an uncovered branch in the coverage report.
The text was updated successfully, but these errors were encountered: