adding code coverage support
Closed this issue · 6 comments
When using code coverage (e.g. with istanbul), the coverage info is stored in window.__COVERAGE__
(if istanbul was set up to use coverageVariable: __COVERAGE__
). It would be nice to be able to extract this info to file so that a code coverage report can be created.
I made a preliminary commit which shows what I would like here: https://github.com/steabert/gulp-jasmine-browser/commit/00eefac155cddcd5ac170dd06b814a96f8080697
seems reasonable to me, would probably need to specify a separate runner that could output the results directly to something that gulp-istanbul or istanbul could take directly rather than just hijacking the regular spec output. This would be pretty straightforward to add.
That would be great, unfortunately I'm very new to this so I have no idea how to get something like that out. One would like to indeed use something like:
const gjb = require('gulp-jasmine-browser')
gulp.src(...)
.pipe(gjb.specRunner({console: true}))
.pipe(gjb.headless()
.pipe(istanbul.writeReport))
We also desire code coverage support so it might come in a new version of gulp-jasmine-browse, no promises though.
Is there any crude way to make this work with Istanbul as is? Trying to find a non-AMD way in Gulp. Doesn't seem to be much out there.
we just need to also track the same information that istanbul is looking for when running specs, it shouldn't be too hard but i haven't looked at the format that it expects yet in order to implement this feature. of course i'd take any pull requests to do this.
I've added support for code coverage. It works utilizing istanbul through nyc and a babel transformation. I'll need to spend some time documenting it but it can be turned on now.