forked from diinvoke/websocket-bench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
76 lines (64 loc) · 1.52 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
73
74
75
76
/*global require*/
var gulp = require('gulp'),
gutil = require('gulp-util'),
mocha = require('gulp-mocha'),
jshint = require('gulp-jshint'),
bump = require('gulp-bump'),
stylish = require('jshint-stylish');
//Application Paths
var paths = {
js : [
'./lib/**/*.js',
'./gulpfile.js',
'./index.js'
],
tests : [
'test/functional/faye.js',
'test/functional/io.js',
'test/lib/baseworker.js',
'test/lib/benchmark.js',
'test/lib/fayeworker.js',
'test/lib/logger.js',
'test/lib/monitor.js',
'test/lib/socketioworker.js',
'test/lib/steps.js',
'test/lib/stopwatch.js'
],
bump : [
'./package.json'
]
};
//Gulp Tasks
gulp.task('jshint', function () {
gulp.src(paths.js)
.pipe(jshint('./.jshintrc'))
.pipe(jshint.reporter(stylish));
});
gulp.task('mocha', function (done) {
gulp.src(paths.tests)
.pipe(mocha({
bail : true,
lookup : true,
ui : 'bdd',
reporter : 'spec'
}))
.on("error", gutil.log);
});
//Version Bump (gulp bump-major | bump-minor | bump-patch)
gulp.task('bump-major', function () {
return gulp.src(paths.bump)
.pipe(bump({type : 'major'}))
.pipe(gulp.dest('./'));
});
gulp.task('bump-minor', function () {
return gulp.src(paths.bump)
.pipe(bump({type : 'minor'}))
.pipe(gulp.dest('./'));
});
gulp.task('bump-patch', function () {
return gulp.src(paths.bump)
.pipe(bump({type : 'patch'}))
.pipe(gulp.dest('./'));
});
//Gulp Runner
gulp.task('default', ['jshint', 'mocha']);