-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
55 lines (46 loc) · 963 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
'use strict';
const
gulp = require('gulp'),
vfs = require('vinyl-fs'),
karma = require('karma').server;
/**
* Run jscs code style
*/
gulp.task('jscs', function () {
let jscs = require('gulp-jscs');
vfs.src('./src/js/**/*.js')
.pipe(jscs({
esnext: true,
configPath: '.jscsrc'
}));
});
/**
* Run jshint for code analysis
*/
gulp.task('lint', function () {
let jshint = require('gulp-jshint');
vfs.src([
'./*.js',
'./src/js/**/*.js',
])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
/**
* Run test once and exit
*/
gulp.task('test', ['lint'], function (done) {
karma.start({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done);
});
/**
* Watch for file changes and re-run tests on each change
*/
gulp.task('tdd', ['lint'], function (done) {
karma.start({
configFile: __dirname + '/karma.conf.js'
}, done);
});
gulp.task('default', ['tdd']);