gulp-livescript-istanbul
v0.0.2
Published
Istanbul livescript & js unit test coverage plugin for gulp
Downloads
10
Maintainers
Readme
gulp-livescript-istanbul
Istanbul unit test coverage plugin for gulp, covering livescript and javascript.
Allows for in-place testing and coverage of livescripts files without the need for compiling and linking to the compiled source.
Displays coverage report in livescript, thanks to source map support in [email protected]
Inspired by gulp-coffee-istanbul & istanbul-traceur
Works on top of any Node.js unit test framework.
Installation
npm install --save-dev gulp-livescript-istanbul
Usage
require! \gulp
require! \gulp-exit
require! \gulp-mocha
{instrument, hook-require, write-reports} = (require \gulp-livescript-istanbul)!
gulp.task \coverage, ->
gulp.src <[src/*.ls]>
# transform livescript code into instrumented javascript code
.pipe instrument!
# hook require and return the instrumented code instead of the original livescript code
.pipe hook-require!
gulp.src <[./test/index.ls]>
# with the require hook in place we can now run any unit test suite
.pipe gulp-mocha!
# write the lcov coverage report to ./coverage directory
.pipe write-reports!
.on \finish, -> process.exit!