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

How to display coverage report in stdout #74

Open
jerrykwchan opened this issue Jul 8, 2016 · 2 comments
Open

How to display coverage report in stdout #74

jerrykwchan opened this issue Jul 8, 2016 · 2 comments

Comments

@jerrykwchan
Copy link

Hi,

I'm using gulp and remap-istanbul to generate test coverage. I would like to know how to display the test coverage report in stdout, like the report generated by gulp-istanbul.

Thanks,
Jerry

@dinoboff
Copy link

dinoboff commented Jul 8, 2016

I personally run my tests with istanbul, then remap the "coverage-final.json" and finaly generate the reports with:

istanbul report lcov text

@jerrykwchan
Copy link
Author

I am using gulp. Here is my remap-Istanbul task. Currently I read the text report file coverage-remap.txt using "fs" module and write the content to stdout using process.stdout.write. I wonder is there a way I can write the coverage report to stdout directly using remap-Istanbul?

gulp.task('remap-istanbul', function () {
return gulp.src('coverage/coverage-final.json')
.pipe(remapIstanbul({
reports: {
'html': 'coverage/remap-report',
'text': 'coverage/coverage-remap.txt'
}
}))
.on('finish', function() {
var coverageReport = fs.readFileSync("coverage/coverage-remap.txt", "utf8");
process.stdout.write(coverageReport);
});
});

@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
@dylans dylans removed the question label Oct 27, 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