-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
63 lines (58 loc) · 975 Bytes
/
gulpfile.js
File metadata and controls
63 lines (58 loc) · 975 Bytes
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
'use strict';
/**
* Dependencies
*/
var
gulp = require('gulp'),
gulpSequence = require('gulp-sequence'),
gulpMocha = require('gulp-mocha'),
gulpJshint = require('gulp-jshint');
/**
* Variables
*/
var
paths = {
lint: [
'./apps/**/**.js',
'./middleware/**/**.js',
'./services/**/**.js',
'./test/**/**.js',
'./gulpfile.js'
],
tests: {
unit: [
'./test/**/*.js'
]
}
};
/**
* Checks JS against JSHint. Uses .jshintrc in root directory
*
* @task lint
*/
gulp.task('lint', function () {
return gulp.src(paths.lint)
.pipe(gulpJshint('.jshintrc'))
.pipe(gulpJshint.reporter('jshint-stylish'));
});
/**
* Runs unit tests
*
* @task test:unit
*/
gulp.task('test:unit', function (cb) {
gulp.src(paths.tests.unit)
.pipe(gulpMocha())
.on('end', cb);
});
/**
* Runs tests
*
* @task test
*/
gulp.task('test', function (cb) {
gulpSequence(
'test:unit',
cb
);
});