-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
48 lines (42 loc) · 1.16 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
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
karma = require('gulp-karma'),
connect = require('gulp-connect');
var testFiles = [
'app/bower_components/angular/angular.js',
'app/bower_components/angular-socket-io/mock/socket-io.js',
'app/bower_components/angular-route/angular-route.js',
'app/bower_components/angular-mocks/angular-mocks.js',
'app/bower_components/angular-socket-io/socket.js',
'app/scripts/app.js',
'app/scripts/controllers/poc.js',
'test/*.spec.js'
];
gulp.task('test', function() {
// Be sure to return the stream
return gulp.src(testFiles)
.pipe(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('connect', function() {
connect.server({
root: 'app',
port: 8000,
livereload: true
});
});
gulp.task('html', function () {
gulp.src('./app/*.html')
.pipe(connect.reload());
});
gulp.task('watch', function () {
gulp.watch(['./app/*.html'], ['html']);
});
gulp.task('dev', ['connect', 'watch']);