-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathgulpfile.js
72 lines (53 loc) · 1.67 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var watch = require('gulp-watch')
var chext = require("chext");
var jsdoc = require("gulp-jsdoc");
var plato = require("plato");
var glob = require("glob");
var unitTests = [ 'test/index.test.js'
, 'test/ext/box.test.js'
, 'test/ext/chat.test.js'
, 'test/ext/path.test.js'
, 'test/ext/peer.test.js'
, 'test/ext/stream.test.js'
, 'test/ext/thtp.test.js'
, 'test/lib/mesh.test.js'
, 'test/lib/pipe.test.js'
, 'test/lib/uri.test.js'];
var srcFiles = ['index.js', 'ext/*.js', 'lib/*.js']
gulp.task('mocha', function() {
return gulp.src( unitTests, { read: false })
.pipe(mocha({ reporter: 'list' }))
.on('error', function(){
})
.on('end', function(){
});
});
gulp.task('dev', ['mocha'], function() {
var ch = new chext()
ch.watchify(unitTests)
ch.onresults = function(results){
console.log("tests complete", results)
}
gulp.watch(unitTests.concat(srcFiles), ["mocha"])
})
var plato = require('plato');
var files = glob.sync("lib/*.js").concat(glob.sync("lib/util/*.js")).concat(glob.sync("ext/*.js"))
var outputDir = './plato';
// null options for this example
var options = {
title: 'Your title here'
};
var callback = function (report){
// once done the analysis,
// execute this
};
gulp.task('doc', function(){
plato.inspect(files, outputDir, {}, callback);
gulp.src(["./lib/*.js", "./ext/*.js"])
.pipe(jsdoc('./doc'))
})
gulp.task('doc-watch', function(){
gulp.watch(srcFiles, ["doc"])
})