1 | 'use strict'
|
2 |
|
3 | gulp = require 'gulp'
|
4 |
|
5 | $ = require('gulp-load-plugins')()
|
6 | spawn = require('child_process').spawn
|
7 |
|
8 |
|
9 | path =
|
10 | src: 'src/**/*.ts'
|
11 | test: 'test/**/*.coffee'
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | gulp.task('test', ->
|
18 | gulp.src([path.src, path.test], { read: false })
|
19 | .pipe($.watch([path.src, path.test], (files) ->
|
20 | files
|
21 | .pipe($.grepStream('**/*.mocha.coffee'))
|
22 | .pipe($.mocha({ reporter: 'spec' }))
|
23 | .on('error', (err) ->
|
24 | this.emit('end')
|
25 | )
|
26 | ))
|
27 | )
|
28 |
|
29 | gulp.task('watch', ->
|
30 | gulp.src([path.src], { read: false })
|
31 | .pipe($.watch([path.src], (files) ->
|
32 | files
|
33 | .pipe($.coffee({bare: true})).on('error', $.util.log)
|
34 | .pipe(gulp.dest('./build/'))
|
35 | ))
|
36 | )
|
37 |
|
38 |
|
39 | gulp.task('default', ['test'])
|