-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgulpfile.js
More file actions
44 lines (39 loc) · 1.01 KB
/
gulpfile.js
File metadata and controls
44 lines (39 loc) · 1.01 KB
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
'use strict'
const gulp = require('gulp')
const cucumber = require('gulp-cucumber')
const eslint = require('gulp-eslint')
const todo = require('gulp-todo')
// Task to lint the code.
gulp.task('lint', function () {
return gulp.src('src/**/*.js')
.pipe(eslint({useEslintrc: true}))
.pipe(eslint.format())
.pipe(eslint.failAfterError())
})
// Task to run tests
gulp.task('test', function (done) {
const features = process.env.FEATURES || '*'
gulp.src(`features/${features}.feature`)
.pipe(cucumber({
steps: 'features/step_definitions/*_step_definition.js',
support: 'features/support/*.js'
}))
.once('error', function (err) {
done(err)
process.kill(process.pid, 'SIGINT')
})
.once('end', function () {
done()
process.kill(process.pid, 'SIGTERM')
})
})
// Task to generate the TODO file
gulp.task('todo', function () {
gulp.src(['src/**/*.js'])
.pipe(todo())
.pipe(gulp.dest('./'))
})
// Default task.
gulp.task('default', ['lint', 'todo'], function () {
gulp.start('test')
})