-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
54 lines (47 loc) · 1.39 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
var gulp = require('gulp');
var inject = require('gulp-inject');
var webserver = require('gulp-webserver');
var karma = require('karma').Server;
var protractor = require("gulp-protractor").protractor;
var naturalSort = require("gulp-natural-sort");
var appBaseUrl = 'http://localhost:8000/app/index.html';
gulp.task('default', function() {
// place code for your default task here
});
gulp.task('inject', function () {
var target = gulp.src('./app/index.html');
// It's not necessary to read the files (will speed up things), we're only after their paths:
var sources = gulp
.src(['./bower_components/**/*.min.js',
'./app/**/*.js',
'./app/**/*.css'
], {
read: false
})
.pipe(naturalSort());
return target
.pipe(inject(sources))
.pipe(gulp.dest('./app'));
});
gulp.task('serve', function() {
gulp.src('.')
.pipe(webserver({
livereload: true,
directoryListing: true,
open: appBaseUrl
}));
});
gulp.task('karma:unit', function(done) {
return karma.start({
configFile: __dirname + '/tests/karma.unit.config.js',
singleRun: true
}, done);
});
gulp.task('protractor:e2e', function(done) {
gulp.src(["./app/tests/*.js"])
.pipe(protractor({
configFile: "tests/protractor.e2e.config.js",
args: ['--baseUrl', appBaseUrl]
}))
.on('error', function(e) { throw e })
});