forked from Bandwidth/node-bandwidth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
48 lines (43 loc) · 1.2 KB
/
gulpfile.js
File metadata and controls
48 lines (43 loc) · 1.2 KB
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
"use strict";
var gulp = require("gulp");
var clean = require("gulp-clean");
var mocha = require("gulp-mocha");
var jshint = require("gulp-jshint");
var jscs = require("gulp-jscs");
var istanbul = require("gulp-istanbul");
gulp.task("jshint", function () {
return gulp.src([ "./lib/*.js", "./test/*.js" ])
.pipe(jshint())
.pipe(jshint.reporter("jshint-stylish"))
.pipe(jshint.reporter("fail"));
});
gulp.task("jscs", function () {
return gulp.src([ "./lib/*.js", "./test/*.js" ])
.pipe(jscs());
});
gulp.task("test", function () {
return gulp.src("coverage", { read : false })
.pipe(clean())
.on("end", function () {
gulp.src([ "lib/*.js" ])
.pipe(istanbul())
.pipe(istanbul.hookRequire())
.on("finish", function () {
gulp.src([ "test/*.js" ], { read : false })
.pipe(mocha({
reporter : "spec",
globals : {
should : require("should")
}
}))
.pipe(istanbul.writeReports())
.pipe(istanbul.enforceThresholds({ thresholds : { global : 100 } }));
});
});
});
gulp.task("default", [ "jshint", "jscs", "test" ])
.on("finish", function () {
console.log("All done");
}).on("error", function () {
console.log("error error error");
});