-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
37 lines (30 loc) · 978 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
37
var gulp = require('gulp'),
gutil = require('gulp-util'),
jshint = require('gulp-jshint'),
shell = require('gulp-shell'),
fs = require('fs'),
bookshelf = require('bookshelf'),
knex;
var config = require('knexfile');
gulp.task('default', ['test', 'watch']);
gulp.task('createdb', function() {
return gulp.src('')
.pipe(shell(['knex migrate:latest', 'knex seed:run']));
});
gulp.task('createtestdb', function() {
return gulp.src('')
.pipe(shell(['knex migrate:latest --env test']));
});
gulp.task('jshint', function() {
return gulp.src('src/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'));
});
gulp.task('test', ['jshint', 'createtestdb'], function() {
return gulp.src('')
.pipe(shell(['istanbul cover _mocha -- -R spec']));
});
gulp.task('watch', function() {
gutil.log('gulp-watch is go!');
return gulp.watch('src/**/*.js', ['jshint']);
});