-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
50 lines (43 loc) · 1.07 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
'use strict';
var gulp = require('gulp'),
gulpLoadPlugins = require('gulp-load-plugins'),
plugins = gulpLoadPlugins();
var testFiles = [
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'slack.js',
'*.spec.js'
];
gulp.task('scripts', function() {
return gulp.src('slack.js')
.pipe(plugins.rename('slack.min.js'))
.pipe(plugins.ngmin())
.pipe(plugins.uglify({
preserveComments: 'some',
outSourceMap: true
}))
.pipe(gulp.dest('.'));
});
gulp.task('jshint', function() {
gulp.src([
'gulpfile.js',
'slack.js',
'*.spec.js'
])
.pipe(plugins.jshint())
.pipe(plugins.jshint.reporter('jshint-stylish'));
});
gulp.task('jasmine', function() {
// Be sure to return the stream
return gulp.src(testFiles)
.pipe(plugins.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('default', ['scripts']);
gulp.task('test', ['jasmine', 'jshint']);