-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
56 lines (45 loc) · 1.06 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
55
56
/*
* Optimus
* https://github.com/vitorbritto/optimus
*
* Copyright (c) 2014 Vitor Britto
* Licensed under the MIT license.
*/
'use strict';
// ========
// SETTINGS
// ========
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
mocha = require('gulp-mocha');
var path = path || {};
path = {
all: ['./lib/*.js', './spec/*.js'],
spec: './spec/*.js'
};
// ======================================
// TASKS
// ======================================
// JSHint Task Configuration
gulp.task('jshint', function () {
gulp.src(path.all)
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});
// Mocha Task Configuration
gulp.task('mocha', function () {
gulp.src(path.spec)
.pipe(mocha({
globals: ['chai'],
timeout: 6000,
ignoreLeaks: false,
ui: 'bdd',
reporter: 'spec'
}));
});
gulp.task('watch', function () {
gulp.watch(path.all, ['jshint']);
});
// Test task
gulp.task('test', ['jshint', 'mocha']);