Karma-coverage checks test coverage in JS files instead of TS in Angular 2
<p>I check test coverage in TypeScript files via Istanbul. And I need to set test threshold via karma-coverage.Istanbul's reports don't match karma-coverage reports (I use Angular-cli) because karma-coverage checks test coverage in JavaScript files instead of TypeScript. I used other plugins such as karma-threshold-reporter,istanbul-threshold-checker but result the same. How can I resolve it?  </p>

<p><a href="https://i.stack.imgur.com/2hwnB.png" rel="nofollow noreferrer">report generate for typeScript files</a></p>

<p><a href="https://i.stack.imgur.com/Y4xfc.png" rel="nofollow noreferrer">report generate for JS files</a></p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>module.exports = function (config) {
  config.set({
    basePath: '',
    frameworks: ['jasmine', 'angular-cli'],
    plugins: [
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-remap-istanbul'),
      require('karma-coverage'),
      require('angular-cli/plugins/karma')
    ],
    files: [
      { pattern: './src/test.ts', watched: false }
    ],
    preprocessors: {
      './src/test.ts': ['angular-cli']
    },
    remapIstanbulReporter: {
      reports: {
        html: 'coverage',
        lcovonly: './coverage/coverage.lcov'
      }
    },
    coverageReporter: {
      dir: 'coverage/',
      reporters: [
        {type: 'text-summary'},
        {type: 'html'}
      ],
      check: {
        global: {
          statements: 70,
          branches: 70,
          functions: 70,
          lines: 50
        }
      }
    },

    angularCli: {
      config: './angular-cli.json',
      environment: 'dev'
    },
    reporters: ['progress', 'karma-remap-istanbul', 'coverage'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Chrome'],
    singleRun: false
  });
};</code></pre>
</div>
</div>
</p>