-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
47 lines (38 loc) · 1.24 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
var gulp = require('gulp'),
plugins = require('gulp-load-plugins')(),
server = require('gulp-express');
gulp.task('server', function (done) {
server.run(['--debug', 'bin/www']);
setTimeout(done, 1000);
});
gulp.task('stop-test-server', ['mocha'], function (done) {
server.stop(done);
});
gulp.task('cucumber', ['server'], function () {
return gulp.src('features/*')
.pipe(plugins.cucumber({
'steps': 'features/steps/*.steps.js',
'support': 'features/support/*.js',
'format': 'pretty'
}))
.pipe(plugins.exit());
});
gulp.task('lint', function () {
return gulp.src(['./**/*.js', '!./node_modules/**'])
.pipe(plugins.jshint())
.pipe(plugins.jshint.reporter('default'));
});
gulp.task('mocha', function () {
return gulp.src('./tests/*.spec.js')
.pipe(plugins.mocha())
.pipe(plugins.exit());
});
gulp.task('watch', function () {
gulp.watch(['./**/*.js', '!./node_modules/**'], ['lint', 'server']);
});
gulp.task('watch-test', ['test'], function () {
gulp.watch(['./**/*.js', '!./node_modules/**'], ['test']);
});
gulp.task('default', ['lint', 'server', 'watch']);
gulp.task('test', ['server', 'cucumber', 'stop-test-server']);
gulp.task('test-mocha', ['server', 'mocha', 'stop-test-server']);