-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
50 lines (43 loc) · 1.4 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
var gulp = require('gulp');
var exec = require('gulp-exec');
var gutil = require('gulp-util');
var coffee = require('gulp-coffee');
var coffeelint = require('gulp-coffeelint');
var mocha = require('gulp-mocha');
var notify = require("gulp-notify");
var paths = {
scripts: [ "srcs/**/*.coffee" ],
tests: "tests/**/*.coffee",
test_files: [ "tests/**/.js", '!tests/buckets.js' ]
};
gulp.task('scripts', function(){
gulp.src(paths.scripts)
.pipe(coffeelint())
.pipe(coffeelint.reporter())
.pipe(coffee({bare: true}))
.on("error", notify.onError(function (error) {
return "Message to the notifier: " + error.message;
}))
.pipe(notify("CoffeeScripted"));
});
gulp.task('tests', function(){
gulp.src(paths.tests)
.pipe(coffee({bare: true}))
.on("error", notify.onError(function (error) {
return "Message to the notifier: " + error.message;
}))
.pipe(notify("Tests CoffeeScripted"))
.pipe(mocha({reporter:'spec'}))
.on('error', notify.onError(function(error) {
return "Tests failed";
}));
});
gulp.task('cover', function(t){
gulp.src(paths.tests)
.pipe(exec("istanbul cover ./node_modules/mocha/bin/_mocha tests/{LinkedList,BSTree}.js tests/sorts/*.js -- -R spec"));
});
gulp.task('watch', function(){
gulp.watch(paths.scripts, ['scripts']);
gulp.watch(paths.tests, ['tests']);
});
gulp.task('default', ['scripts', 'tests', 'watch']);