UNPKG

775 Btext/coffeescriptView Raw
1'use strict'
2
3gulp = require 'gulp'
4# load plugins
5$ = require('gulp-load-plugins')()
6spawn = require('child_process').spawn
7
8# Compile jobs
9path =
10 src: 'src/**/*.ts'
11 test: 'test/**/*.coffee'
12
13
14
15
16# Main jobs
17gulp.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
29gulp.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
39gulp.task('default', ['test'])