remap-istanbul icon indicating copy to clipboard operation
remap-istanbul copied to clipboard

report displays results for ts and js files

Open caperavensoftware opened this issue 8 years ago • 2 comments

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?

caperavensoftware avatar Aug 12 '16 09:08 caperavensoftware

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.

chaowlert avatar Sep 21 '16 10:09 chaowlert

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?

ijabit avatar Oct 11 '16 00:10 ijabit