-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathgulpfile.js
54 lines (47 loc) · 1.24 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
/*
* gulp-stubby-server
* https://github.com/felixzapata/gulp-stubby-server
*
* Copyright (c) 2014 Felix Zapata
* Licensed under the MIT license.
*/
'use strict';
var gulp = require('gulp'),
jshint = require('gulp-jshint'),
stubby = require('./index.js'),
nodeunit = require('gulp-nodeunit');
gulp.task('jshint', function() {
var options = {
jshintrc: '.jshintrc'
};
return gulp.src([
'gulpfile.js',
'index.js',
'test/test.js'
])
.pipe(jshint(options));
});
gulp.task('stubby', gulp.series('jshint', function (cb) {
var options = {
stubs: 8000,
tls: 8443,
admin: 8001,
persistent: false,
files: [
'test/fixtures/cities.yml',
'test/fixtures/localities.yaml',
'test/fixtures/places.json',
'test/fixtures/towns.js',
'test/fixtures/users.json',
'test/fixtures/*.{json,yaml,yml,js}'
]
};
return stubby(options, cb);
}));
gulp.task('nodeunit', gulp.series('stubby', function() {
return gulp.src('test/test.js').pipe(nodeunit()).on('end', function() {
process.nextTick(function() {
process.exit(0);
});
});
}));