-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
42 lines (35 loc) · 1.01 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
"use strict";
var gulp = require("gulp");
var jshint = require("gulp-jshint");
var jscs = require("gulp-jscs");
var istanbul = require("gulp-istanbul");
var mocha = require("gulp-mocha");
var files = [
"./compile.js",
"./mixin.js",
];
var configFiles = [
"./gulpfile.js",
"./test/**/*.js",
];
gulp.task("jscs", function () {
return gulp.src(files.concat(configFiles))
.pipe(jscs("./.jscs.json"));
});
gulp.task("jshint", function () {
return gulp.src(files.concat(configFiles))
.pipe(jshint())
.pipe(jshint.reporter("default"))
.pipe(jshint.reporter("fail"));
});
gulp.task("mocha", function (callback) {
gulp.src(files)
.pipe(istanbul())
.on("finish", function () {
gulp.src(["test/_init.js", "test/**/*Spec.js"])
.pipe(mocha({ reporter: "spec" }))
.pipe(istanbul.writeReports({ dir: "./coverage" }))
.on("end", callback);
});
});
gulp.task("test", ["jshint", "jscs", "mocha"]);