forked from sequelize/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
53 lines (46 loc) · 1.2 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
'use strict';
var args = require('yargs').argv;
var gulp = require('gulp');
var jscs = require('gulp-jscs');
var jshint = require('gulp-jshint');
var mocha = require('gulp-mocha');
var path = require('path');
var runSequence = require('run-sequence');
gulp.task('default', function (done) {
runSequence('lint', 'test', done);
});
gulp.task('test', function (done) {
runSequence('test-unit', 'test-integration', done);
});
gulp.task('lint', function (done) {
runSequence('lint-code', done);
});
gulp.task('lint-code', function () {
return gulp
.src([
'./gulpfile.js',
'./index.js',
'./bin/**/*',
'./lib/**/*.js',
'!./lib/assets/**/*.js',
'./test/**/*.js',
'!./test/support/tmp/**/*.js'
])
.pipe(jscs())
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
gulp.task('test-unit', function () {
// TODO
});
gulp.task('test-integration', function () {
gulp
.src(path.resolve(__dirname, 'test', '**', '*.test.js'), { read: false })
.pipe(mocha({
reporter: 'spec',
ignoreLeaks: true,
timeout: 30000,
grep: args.grep
}));
});