forked from city41/node-sql-fixtures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
54 lines (44 loc) · 1.26 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
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var shell = require('gulp-shell');
var jshint = require('gulp-jshint');
function runSpecs(path) {
return gulp.src([
'./test/helpers/*.js',
path
])
.pipe(mocha());
}
gulp.task('lint', function() {
return gulp.src(['./lib/**/*.js', './test/**/*.js'])
.pipe(jshint({ loopfunc: true, expr: true }))
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
gulp.task('test:unit', ['lint'], function() {
return runSpecs('./test/unit/*.js');
});
gulp.task('test:integration:postgres', function() {
return runSpecs('./test/integration/postgres*.js');
});
gulp.task('test:integration:mysql', function() {
return runSpecs('./test/integration/mysql*.js');
});
gulp.task('test:integration:maria', function() {
return runSpecs('./test/integration/maria*.js');
});
gulp.task('delete:sqlite', shell.task(['rm -f ./sqlite-integration-spec.db']));
gulp.task('test:integration:sqlite', ['delete:sqlite'], function() {
return runSpecs('./test/integration/sqlite*.js');
});
gulp.task('test:integration', [
'test:integration:sqlite',
'test:integration:postgres',
'test:integration:mysql',
'test:integration:maria'
])
gulp.task('test', [
'lint',
'test:unit',
'test:integration'
]);