-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
61 lines (52 loc) · 1.35 KB
/
gulpfile.js
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
var gulp = require('gulp')
, $ = require('gulp-load-plugins')()
, coffee = require('coffee-script/register')
, livescript = require('livescript')
, del = require('del')
gulp.task('livescript', function () {
return gulp.src('livescript.ls')
.pipe($.livescript({ bare: true }))
.pipe($.rename('index.livescript.js'))
.pipe(gulp.dest('.'))
})
gulp.task('coffee', function () {
return gulp.src('coffee.coffee')
.pipe($.coffee({ bare: true }))
.pipe($.rename('index.coffee.js'))
.pipe(gulp.dest('.'))
})
gulp.task('test:teardown', function (done) {
del([ 'index.coffee.js', 'index.livescript.js' ])
done()
})
gulp.task('test:livescript', gulp.series([ 'livescript' ]), function () {
return gulp.src('tests/loader.spec.ls')
.pipe($.mocha({
compilers: {
ls: livescript
}
}))
})
gulp.task('test:coffee', gulp.series([ 'coffee' ]), function () {
return gulp.src('tests/loader.spec.coffee')
.pipe($.mocha({
compilers: {
coffee: coffee
}
}))
})
gulp.task('test:js', function () {
return gulp.src('tests/loader.spec.js')
.pipe($.mocha())
})
gulp.task('test', gulp.series([
'test:js',
'test:coffee',
'test:livescript',
'test:teardown',
]), function (done) {
done()
})
gulp.task('default', gulp.series([ 'test' ]), function (done) {
done()
})