Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

report displays results for ts and js files #83

Open
caperavensoftware opened this issue Aug 12, 2016 · 2 comments
Open

report displays results for ts and js files #83

caperavensoftware opened this issue Aug 12, 2016 · 2 comments

Comments

@caperavensoftware
Copy link

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?

@chaowlert
Copy link

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.

@ijabit
Copy link

ijabit commented Oct 11, 2016

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?

@dylans dylans added the bug label Nov 1, 2016
@dylans dylans added this to the 0.9.0 milestone Jan 11, 2017
@dylans dylans modified the milestones: 0.9.0, 0.10.0 Feb 22, 2017
@dylans dylans removed this from the 0.10.0 milestone Jan 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants