forked from liferay/liferay-frontend-source-formatter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
54 lines (45 loc) · 1.15 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
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
var runSequence = require('run-sequence');
gulp.task('coveralls', function () {
gulp.src('coverage/**/lcov.info')
.pipe(plugins.coveralls());
});
gulp.task('test', function(done) {
return runSequence('test-unit', done);
});
gulp.task('test-complexity', function() {
return gulp.src(['lib/**/*.js'])
.pipe(plugins.complexity({
cyclomatic: [4, 7, 12],
halstead: [15, 15, 20]
}));
});
gulp.task('test-unit', function() {
process.argv.push('--display-raw');
return gulp.src(['test/**/*.js', '!test/fixture/*.js'])
.pipe(plugins.mocha());
});
gulp.task('test-cover', function() {
return gulp.src(['lib/**/*.js'])
.pipe(plugins.istanbul())
.pipe(plugins.istanbul.hookRequire());
});
gulp.task('test-coverage', ['test-cover'], function() {
process.argv.push('--display-raw');
return gulp.src(['test/**/*.js', '!test/fixture/*.js'])
.pipe(plugins.mocha())
.pipe(plugins.istanbul.writeReports());
});
gulp.task('toc', function(done) {
gulp.src('./README.md')
.pipe(
plugins.doctoc(
{
title: '### Jump to Section',
depth: 2
}
)
)
.pipe(gulp.dest('./'));
});