gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 787 forks source link

Istanbul Report on several json reports with preprocess #805

Open sebadom opened 7 years ago

sebadom commented 7 years ago

I have several task of karma that run some test in different modules of the application. Each of this task preprocess the files with traceur to change it from es6 -> es5 and then preprocess them with coverage (karma-coverage). This is working ok with the coverage being calculated and reporting it in HTML and JSON. When opening the HTML it shows the transpiled version done by the preprocessor. Now i need to merge/combine all this reports into a single one and here is where i start getting an issue

I was getting an exception where couldn't get the property text from undefined, taking a look into it and placing some logs i saw that istanbul was trying to get a line number which didn't exist in the source file, and then i realised what was happening, while the coverage and the html report was using the transpiled version, running the merge using the json reports is pointing to the source files in es6 and not the transpiled version... is there any way i can fix this? is there a way to