-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathgulpfile.js
34 lines (30 loc) · 879 Bytes
/
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
var gulp = require('gulp');
var watch = require('gulp-watch');
var child_process = require('child_process');
var cucumber;
var running = false;
var options = ['node_modules/.bin/cucumber-js',
'features',
'-r', 'features/step_definitions',
'-f', 'pretty'];
gulp.task('cucumber', function() {
if(!running) {
running = true;
cucumber = child_process.spawn('node', options)
.on('exit', function() {
running = false;
});
cucumber.stdout.on('data', function(d) {
console.log(String(d));
});
cucumber.stderr.on('data', function(d) {
console.error(String(d));
});
}
});
gulp.task('watch-tests', function() {
gulp.src(['features/**/*.js', 'script/**/*.js'])
.pipe(watch(function() {
gulp.run('cucumber');
}));
});