forked from balihoo/lru-cache-promise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.coffee
43 lines (35 loc) · 996 Bytes
/
gulpfile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
gulp = require 'gulp'
coffee = require 'gulp-coffee'
coffeelint = require 'gulp-coffeelint'
mocha = require 'gulp-mocha'
istanbul = require 'gulp-coffee-istanbul'
del = require 'del'
sources =
js: 'lib/**/*.js'
coffee: 'src/**/*.coffee'
test: 'test/**/*.coffee'
gulp.task 'clean', (callback) ->
del [sources.js], callback
gulp.task 'lint', ->
gulp.src sources.coffee
.pipe coffeelint()
.pipe coffeelint.reporter()
.pipe coffeelint.reporter 'fail'
gulp.task 'compile', ->
gulp.src sources.coffee
.pipe coffee bare: true
.pipe gulp.dest 'lib/'
gulp.task 'watch', ['compile'], ->
gulp.watch sources.coffee, ['compile']
gulp.task 'test', ['compile'], ->
gulp.src sources.test
.pipe mocha()
gulp.task 'cover', ['compile'], ->
gulp.src sources.coffee
.pipe istanbul(includeUntested: true)
.pipe istanbul.hookRequire()
.on 'finish', ->
gulp.src sources.test
.pipe mocha()
.pipe istanbul.writeReports()
gulp.task 'build', ['clean', 'lint', 'cover']