-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
70 lines (59 loc) · 2.06 KB
/
gulpfile.js
File metadata and controls
70 lines (59 loc) · 2.06 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
var gulp = require('gulp'),
del = require('del'),
jshint = require('gulp-jshint'),
runsync = require('run-sequence'),
mocha = require('gulp-mocha');
var builder = require('./');
gulp.task('clean', function(cb) {
return del(['./test/build'], cb);
});
gulp.task('lint', function() {
return gulp.src(['./gulpfile.js', './index.js', './test/test.js'])
.pipe(jshint())
.pipe(jshint.reporter('default', { verbose: true }));
});
gulp.task('test', function() {
return gulp.src('./test/test.js')
.pipe(mocha());
});
gulp.task('testbuild:simple-modules.json', function() {
return gulp.src('./test/manifesto/simple-modules.json')
.pipe(builder())
.pipe(gulp.dest('./test/build'));
});
gulp.task('testbuild:multiple-modules.json', function() {
return gulp.src('./test/manifesto/multiple-modules.json')
.pipe(builder({
cwd: './test/fixtures/',
prefix: 'test-',
suffix: '.latest'
}))
.pipe(gulp.dest('./test/build'));
});
gulp.task('testbuild:another-modules.json', function() {
return gulp.src('./test/manifesto/another-modules.json')
.pipe(builder({
cwd: './test/fixtures/'
}))
.pipe(gulp.dest('./test/build'));
});
gulp.task('testbuild:globable-modules.json', function() {
var EOL = require('os').EOL;
return gulp.src('./test/manifesto/globable-modules.json')
.pipe(builder({
cwd: './test/fixtures/',
ext: 'md',
separator: EOL +'----'+ EOL
}))
.pipe(gulp.dest('./test/build'));
});
gulp.task('testbuild', function(done) {
runsync('clean', [
'testbuild:simple-modules.json',
'testbuild:multiple-modules.json',
'testbuild:another-modules.json',
'testbuild:globable-modules.json'], done);
});
gulp.task('default', function(done) {
runsync('lint', 'test', 'testbuild', done);
});