forked from alastairparagas/NamecheapAPI
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
50 lines (41 loc) · 1.33 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
(function () {
'use strict';
var gulp = require('gulp'),
gulpJshint = require('gulp-jshint'),
gulpWatch = require('gulp-watch'),
gulpPlumber = require('gulp-plumber'),
gulpMocha = require('gulp-mocha'),
jshintStylish = require('jshint-stylish'),
colors = require('colors');
function jshint() {
return gulp.src(['gulpfile.js',
'namecheap-api.js',
'Namecheap/**/*.js'])
.pipe(gulpJshint())
.pipe(gulpJshint.reporter(jshintStylish));
}
function mocha() {
return gulp.src('tests/**/*.js')
.pipe(gulpPlumber())
.pipe(gulpMocha());
}
gulp.task('jshint', jshint);
gulp.task('mocha', mocha);
function jshintWatch() {
return gulpWatch('**/*.js', function () {
console.log(colors.yellow.underline("JS Hint"));
jshint();
});
}
function mochaWatch() {
mocha();
return gulpWatch(['namecheap-api.js',
'namecheap/**/*.js',
'tests/**/*.js'], function () {
console.log(colors.yellow.underline("Mocha Run"));
mocha();
});
}
gulp.task('jshintWatch', jshintWatch);
gulp.task('mochaWatch', mochaWatch);
}());