-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgulpfile.js
52 lines (41 loc) · 1.05 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
/*
* Copyright 2014, All Rights Reserved.
*
* Code licensed under the MIT License:
* http://vitorbritto.mit-license.org/
*
* Author: Vitor Britto <[email protected]>
*/
'use strict';
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
mocha = require('gulp-mocha'),
stylish = require('jshint-stylish');
// Lint Scripts
gulp.task('jshint', function () {
gulp.src(['lib/*.js', 'spec/**/*.js'])
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});
// Run Unit tests
gulp.task('mocha', function () {
gulp.src('spec/*.js')
.pipe(mocha({
globals: ['chai'],
timeout: 6000,
ignoreLeaks: false,
ui: 'bdd',
reporter: 'spec'
}));
});
// CUSTOMIZE
// Run Unit tests
gulp.task('lint', ['jshint']);
// Run Unit tests
gulp.task('spec', ['mocha']);
// Watch for changes
gulp.task('watch', function () {
gulp.watch(['lib/*.js', 'spec/**/*.js'], ['jshint']);
});
// Default Task - Run all
gulp.task('default', ['jshint', 'mocha', 'watch']);