forked from dalelotts/angular-date-time-input
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
88 lines (70 loc) · 1.75 KB
/
gulpfile.js
File metadata and controls
88 lines (70 loc) · 1.75 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
86
87
88
/*globals require, __dirname */
/* jshint node:true */
'use strict';
var gulp = require('gulp');
var jscs = require('gulp-jscs');
var jshint = require('gulp-jshint');
var karmaConfig = __dirname + '/karma.conf.js';
var lodash = require('lodash');
var paths = require('./paths');
var plato = require('plato');
var Server = require('karma').Server;
gulp.task('clean', function () {
var del = require('del');
return del([
'build'
]);
});
gulp.task('default', ['clean:mobile']);
gulp.task('complexity', function (done) {
var callback = function () {
done();
};
plato.inspect(paths.lint, 'build/complexity', {title: 'prerender', recurse: true}, callback);
});
gulp.task('jscs', function () {
return gulp
.src(paths.lint)
.pipe(jscs('.jscsrc'));
});
gulp.task('lint', function () {
return gulp
.src(paths.lint)
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('default', {verbose: true}))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
});
var testConfig = function (options) {
var travisOptions = process.env.TRAVIS &&
{
browsers: ['Firefox'],
reporters: ['dots', 'coverage', 'threshold']
};
return lodash.assign(options, travisOptions);
};
gulp.task('tdd', function (done) {
gulp.watch(paths.all, ['jscs', 'lint']);
var config = testConfig(
{
autoWatch: true,
browsers: ['PhantomJS'],
configFile: karmaConfig,
singleRun: false
}
);
var server = new Server(config, done);
server.start();
});
gulp.task('test', ['jscs', 'lint'], function (done) {
var config = testConfig(
{
configFile: karmaConfig,
singleRun: true,
reporters: ['progress', 'coverage', 'threshold']
}
);
var server = new Server(config, done);
server.start();
});
gulp.task('default', ['complexity', 'test']);