-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
85 lines (70 loc) · 2.41 KB
/
gulpfile.js
File metadata and controls
85 lines (70 loc) · 2.41 KB
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
81
82
83
84
85
/* jshint node: true */
(function () {
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var connect = require('gulp-connect');
var rename = require('gulp-rename');
var concat = require('gulp-concat');
var bump = require('gulp-bump');
var watch = require('gulp-watch');
var path = require('path');
var jshint = require('gulp-jshint');
var runSequence = require('run-sequence');
var factory = require("widget-tester").gulpTaskFactory;
var appJSFiles = [
'src/js/**/*.js',
'test/**/*.js'
];
gulp.task('config', function() {
var env = process.env.NODE_ENV || 'dev';
gutil.log('Environment is', env);
return gulp.src(['./src/js/config/' + env + '.js'])
.pipe(rename('config.js'))
.pipe(gulp.dest('./src/js/config'));
});
// Defined method of updating:
// Semantic
gulp.task('bump', function(){
return gulp.src(['./package.json', './bower.json'])
.pipe(bump({type:'patch'}))
.pipe(gulp.dest('./'));
});
gulp.task('lint', function() {
return gulp.src(appJSFiles)
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'))
.on('error', function(err) {
throw err;
});
});
gulp.task('concat', ['config'], function () {
gulp.src(['./src/js/config/config.js', './src/js/*.js'])
.pipe(concat(require(path.join(__dirname, 'package.json')).name + '.js'))
.pipe(gulp.dest('./dist/'));
});
gulp.task('build', ['lint', 'concat']);
gulp.task("e2e:server", ["config"], factory.testServer());
gulp.task("test:e2e", ["e2e:server"], factory.testE2E());
gulp.task("test:unit:ng", factory.testUnitAngular(
{testFiles: [
'components/jquery/dist/jquery.js',
'components/q/q.js',
'components/angular/angular.js',
'components/angular-mocks/angular-mocks.js',
'src/js/*.js',
'src/js/*/*.js',
'src/js/**/*.js',
'src/js/**/**/*.js',
'test/unit/fixtures/*.js',
'test/unit/**/*spec.js']}
));
gulp.task("webdriver_update", factory.webdriveUpdate());
gulp.task("e2e:server-close", factory.testServerClose());
gulp.task("test:e2e:settings", ["webdriver_update", "e2e:server"], factory.testE2EAngular());
gulp.task("test", function(cb) {
runSequence("test:unit:ng", "test:e2e:settings", "e2e:server-close", cb);
});
gulp.task('default', ['build']);
})();