Skip to content
This repository has been archived by the owner on Jul 8, 2019. It is now read-only.

Javascript LCOV files #50

Closed
bluntspoon opened this issue Sep 1, 2016 · 5 comments
Closed

Javascript LCOV files #50

bluntspoon opened this issue Sep 1, 2016 · 5 comments

Comments

@bluntspoon
Copy link

Firstly welldone on a great plugin.

I have a large typescript project, with karma unit tests. And I currently use this plugin to do Linting of my TS files. I'm now trying to add the karma generated LCOV report to the process, but running into issues.

Does your LCOV parser support reading of LCOV files generated off javascript files. The report is generated and read in correctly by Teamcity. But as soon as I pump it into the Sonar it doesn't yeild any results.

Any help with this is appreciated.
Andrew

@Pablissimo
Copy link
Owner

So - the LCOV file needs to be translated via a sourcemap to point back to your TypeScript files (since multiple lines of TypeScript may transpile out to a single line of JS, or vice-versa, it's the only way to get accurate line-level coverage). Now there's an open issue surronding this: #48 which I'm not sure about.

If you've already done the conversion and are seeing problems, you've probably got what #48's got - otherwise you'll need to re-map your LCOV back to TypeScript files for the plugin to use the data.

@bluntspoon
Copy link
Author

Thanks, was wondering if your plugin would report on the JS version of the LCOV. If not I'll have to setup the Istanbul-remap step.

@Pablissimo
Copy link
Owner

Pablissimo commented Sep 1, 2016

Sadly not, to do so would require it to understand sourcemaps which I guess could be looked at as an enhancement.

@rodikal
Copy link

rodikal commented Sep 2, 2016

@Pablissimo
Copy link
Owner

Closing as a workaround exists, and pulling in more deps to parse sourcemaps doesn't seem like the right way to approach this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants