remap-istanbul
remap-istanbul copied to clipboard
report displays results for ts and js files
The reason why I am using remap is so that I can see the reports in ts. Now i see duplicates, one for the ts and one for the js. The js file report displays wrong and the ts file displays correctly.
I don't want to see the js files as part of the report. Is there a configuration I can put off to make the js files go away?
Hi,
I have the same problem. Currently I solved by following
gulp.task('remap-istanbul', function () {
return gulp.src('coverage/coverage-final.json')
.pipe(remapIstanbul())
.pipe(change(function (data) {
var json = JSON.parse(data);
var keys = Object.keys(json);
for (var key of keys) {
if (key.endsWith('.js')) {
delete json[key];
}
}
return JSON.stringify(json);
}))
.pipe(istanbulReport({
dir: './coverage',
reporters: ['lcov', 'json', 'text', 'text-summary']
}));
});
Basically, I just remove all js files from coverage json and print reports. You might need gulp-change
, and gulp-istanbul-report
for above code.
I agree. This workaround won't work for me since I have both TS and JS files. If you go from ES6 to ES5 via Babel, it doesn't show both .JS files, so why should it show both the a TS and JS file?