-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
80 lines (69 loc) · 1.69 KB
/
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
'use strict';
var gulp = require('gulp');
/**
* Bump version
*/
gulp.task('bump:major', function(){
gulp.src(['./package.json', './bower.json'])
.pipe(require('gulp-bump')({type:'major'}))
.pipe(gulp.dest('./'));
});
gulp.task('bump:minor', function(){
gulp.src(['./package.json', './bower.json'])
.pipe(require('gulp-bump')({type:'minor'}))
.pipe(gulp.dest('./'));
});
gulp.task('bump:patch', function(){
gulp.src(['./package.json', './bower.json'])
.pipe(require('gulp-bump')({type:'patch'}))
.pipe(gulp.dest('./'));
});
/**
* Run tests.
*/
gulp.task('test', function () {
return gulp.src([
'bower_components/jquery/dist/jquery.js',
'bower_components/lodash/dist/lodash.js',
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'src/**/*.js',
'test/**/*.js'
])
.pipe(require('gulp-karma')({
configFile: 'karma.conf.js',
action: 'run'
}))
.on('error', function(err) {
// Make sure failed tests cause gulp to exit non-zero
throw err;
});
});
gulp.task('test:watch', function () {
gulp.src([
'bower_components/jquery/dist/jquery.js',
'bower_components/lodash/dist/lodash.js',
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'src/**/*.js',
'test/**/*.js'
])
.pipe(require('gulp-karma')({
configFile: 'karma.conf.js',
action: 'watch'
}));
});
/**
* Lint JS files.
*/
gulp.task('lint', function() {
var jshint = require('gulp-jshint');
return gulp.src([
'./gulpfile.js',
'./src/**/*.js',
'./test/**/*.js'
])
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});