forked from shiwano/typhen-json-schema
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
36 lines (29 loc) · 840 Bytes
/
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
'use strict';
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')();
var paths = {
gulpfile: 'gulpfile.js',
src: 'index.js',
test: 'test/index_test.js',
testDest: '.tmp/',
templates: 'templates/**/*.hbs',
testTypings: 'test/fixtures/definitions.d.ts'
};
var mochaOptions = {
reporter: 'spec',
timeout: 10000
};
gulp.task('jshint', function() {
return gulp.src([paths.gulpfile, paths.src, paths.test])
.pipe(plugins.jshint())
.pipe(plugins.jshint.reporter('default'))
.pipe(plugins.jshint.reporter('fail'));
});
gulp.task('test', function() {
return gulp.src(paths.test)
.pipe(plugins.spawnMocha(mochaOptions));
});
gulp.task('default', ['jshint', 'test']);
gulp.task('watch', function() {
gulp.watch([paths.src, paths.test, paths.templates, paths.testTypings], ['test']);
});