-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
38 lines (31 loc) · 928 Bytes
/
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
/*jslint node: true, vars: true */
"use strict";
var gulp = require("gulp");
var jshint = require("gulp-jshint");
var mocha = require("gulp-mocha");
var monitorCtrlC = require("monitorctrlc");
var taskFromStreams = require("gulp-taskfromstreams");
var jslint = require("./");
var rootFiles = "*.js*";
var libFiles = "lib/*.js";
var libExcludes = "!lib/jslint.js";
var testFiles = "test/*.js";
gulp.task("lint", taskFromStreams(function () {
return [
gulp.src([rootFiles, libFiles, libExcludes, testFiles]),
jshint(),
jslint.run(),
jslint.report({ emitErrorAtEnd: true })
];
}));
gulp.task("test", ["lint"], taskFromStreams(function () {
return [
gulp.src(testFiles),
mocha({ reporter: "spec" })
];
}));
gulp.task("watch", function () {
monitorCtrlC();
gulp.watch([rootFiles, libFiles, libExcludes, testFiles], ["test"]);
gulp.start("test");
});