-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathGulpfile.js
More file actions
45 lines (38 loc) · 1.06 KB
/
Gulpfile.js
File metadata and controls
45 lines (38 loc) · 1.06 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
45
'use strict'
var gulp = require('gulp')
var standard = require('gulp-standard')
var mocha = require('gulp-mocha')
var istanbul = require('gulp-istanbul')
var coveralls = require('gulp-coveralls')
gulp.task('standard', function () {
return gulp.src(['./app.js'])
.pipe(standard())
.pipe(standard.reporter('default', {
breakOnError: true
}))
})
gulp.task('pre-test', function () {
return gulp.src(['lib/**/*.js'])
// Covering files
.pipe(istanbul())
// Force `require` to return covered files
.pipe(istanbul.hookRequire())
})
gulp.task('test', ['pre-test'], function (cb) {
return gulp.src([
'./test/**/*.js'
])
.pipe(mocha({
reporter: 'mocha-junit-reporter',
reporterOptions: {
mochaFile: process.env.CIRCLE_TEST_REPORTS + '/junit/results.xml'
}
}))
.pipe(istanbul.writeReports()) // stores reports in "coverage" directory
})
gulp.task('coveralls', function (cb) {
return gulp.src('./coverage/lcov.info')
.pipe(coveralls())
})
gulp.task('dev', ['standard', 'test', 'coveralls'])
gulp.task('default', ['main'])