When it compiles my code, TypeScript includes an __extends declaration at the top of every file:
var __extends = this.__extends || function (d, b) {
/* istanbul ignore next */
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
__.prototype = b.prototype;
d.prototype = new __();
};
This works fine behind-the-scenes, but it creates an inconsistency when it comes to using something like karma-coverage to generate reports. This declaration contains two function calls and a branch in the code (the || usage), which only ever get exercised on the first declaration, leaving dozens (if not hundreds) of subsequent declarations for which there is no coverage. This makes a file with otherwise 100% code coverage look sorely uncovered in the coverage reports.
Has anyone solved this problem?
I found a work item at the typescript codeplex. I hope the typescript guys solve this issue soon. You can find more on that here: typescript workitem 2002
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With