-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathgulpfile.js
39 lines (32 loc) · 868 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
var gulp = require('gulp');
var jshint = require('gulp-jshint');
var karma = require('karma').server;
var PATHS = {
src: 'src/**/*.js',
test: 'test/**/*.spec.js'
};
var karmaCommonConf = {
browsers: process.env.TRAVIS ? ['Firefox'] : ['Chrome'],
frameworks: ['jasmine'],
files: [
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
PATHS.src, PATHS.test
],
singleRun: true,
reporters: ['dots']
};
gulp.task('lint', function () {
gulp.src([PATHS.src, PATHS.test])
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
gulp.task('tdd', function (done) {
karmaCommonConf.singleRun = false;
karma.start(karmaCommonConf, done);
});
gulp.task('test', function (done) {
karma.start(karmaCommonConf, done);
});
gulp.task('default', ['lint', 'test']);