Angular-cli: Webstorm (intellij) coverage integration with the angular cli

Created on 14 Dec 2016  路  4Comments  路  Source: angular/angular-cli

Please provide us with the following information:

OS?

Windows 10

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
angular-cli: 1.0.0-beta.21
node: 6.9.1
os: win32 x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
n/a

The log given by the failure.

Normally this include a stack trace and some more information.
n/a

Mention any other details that might be useful.

Is there a way to display code-coverage inside of intellij/webstorm? The cli uses the test.ts file which does some aggregating of the spec files. The problem is, karma uses that and only that file to test. Is there a guide? Perhaps I'm just doing in incorrect?
Thank you!

help wanted RFC / discussion / question

Most helpful comment

I did some research into this.

  • The existing Karma coverage feature in Webstorm works specifically for the karma-coverage plugin.
  • There is an old issue on Youtrack to support coverage in a generic way.
  • The 'communicating an lcov file to Intelij'-part seems to be trivial:
// start
intellijUtil.sendIntellijEvent('coverageStartupStatus', {
    coveragePreprocessorSpecifiedInConfig : coveragePreprocessorSpecifiedInConfig,
    coverageReporterFound : coverageReporterFound
});

// end
intellijUtil.sendIntellijEvent('coverageFinished', lcovFilePath);

I think the ideal solution would be to have a plugin (preferably made by the Webstorm team itself), which:

  • Allows watching paths for changes to lcov files.
  • Triggers the 'coverageFinished' event whenever a lcov file changes.

This would solve the coverage issue for basically all use cases (not just Angular 2), because lcov reporters exist for basically everything.

All 4 comments

Right now the Karma plugin for IntelliJ / WebStorm only supports karma-coverage for the coverage reporter. This keeps the stats from showing up in the IDE when you run coverage.

No idea how to do it in WebStorm. I don't use it myself. Will tag issue for community help.

I did some research into this.

  • The existing Karma coverage feature in Webstorm works specifically for the karma-coverage plugin.
  • There is an old issue on Youtrack to support coverage in a generic way.
  • The 'communicating an lcov file to Intelij'-part seems to be trivial:
// start
intellijUtil.sendIntellijEvent('coverageStartupStatus', {
    coveragePreprocessorSpecifiedInConfig : coveragePreprocessorSpecifiedInConfig,
    coverageReporterFound : coverageReporterFound
});

// end
intellijUtil.sendIntellijEvent('coverageFinished', lcovFilePath);

I think the ideal solution would be to have a plugin (preferably made by the Webstorm team itself), which:

  • Allows watching paths for changes to lcov files.
  • Triggers the 'coverageFinished' event whenever a lcov file changes.

This would solve the coverage issue for basically all use cases (not just Angular 2), because lcov reporters exist for basically everything.

@marklagendijk thanks for sharing your vision! I agree that the CLI might not be the right place for this feature request. I'll close the issue, please open a new one in case I'm missing something.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jmurphzyo picture jmurphzyo  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments

NCC1701M picture NCC1701M  路  3Comments

MateenKadwaikar picture MateenKadwaikar  路  3Comments

delasteve picture delasteve  路  3Comments