If you have a build process using gulp or grunts, after your typescript is compiled into JavaScript, you can say Istanbul (that karma coverage is used to create code coverage) to ignore certain lines (like those annoying typescript-generated lines) .
You can say that Istanbul ignores the line using the comment /* istanbul ignore next */
(function (app) { ... })(app || (app = {}));
Here is a post explaining how to do this with gulp.
fooobar.com/questions/249137 / ...
source share