1 | gulp = require 'gulp'
|
2 | gutil = require 'gulp-util'
|
3 | grep = require 'gulp-grep-stream'
|
4 | mocha = require 'gulp-mocha'
|
5 | watch = require 'gulp-watch'
|
6 |
|
7 | gulp.on 'err', (e) ->
|
8 | gulp.on 'task_err', (e) ->
|
9 | if process.env.NODE_ENV isnt 'workstation'
|
10 | gutil.log e
|
11 | process.exit 1
|
12 |
|
13 | gulp.task 'spec', ->
|
14 | gulp.src('src/*.coffee')
|
15 | .pipe(mocha())
|
16 |
|
17 | gulp.task 'default', ->
|
18 | gulp.src("src/*.coffee",
|
19 | read: false
|
20 | ).pipe watch(
|
21 | emit: "all"
|
22 | , (files) ->
|
23 | files
|
24 | .pipe(grep("**/*.spec.*"))
|
25 | .pipe(mocha(reporter: "spec")
|
26 | .on "error", (err) ->
|
27 | console.log err.stack unless /tests? failed/.test(err.stack)
|
28 | return
|
29 | )
|
30 | return
|
31 | )
|
32 | return |
\ | No newline at end of file |