forked from Aztec03hub/superlogin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
45 lines (37 loc) · 1.18 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
const { src, series }= require('gulp'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
mocha = require('gulp-mocha');
function lint() {
return src(['./lib/**/*.js', './test/*.js'])
.pipe(jshint({node: true, mocha: true}))
.pipe(jshint.reporter(stylish))
.pipe(jshint.reporter('fail'));
};
function middleware_test() {
return src(['test/middleware.spec.js'], {read: false})
.pipe(mocha({timeout: 2000}));
};
function dbauth_test() {
return src(['test/dbauth.spec.js'], {read: false})
.pipe(mocha({timeout: 2000}));
};
// these three tasks all just need dbauth
function session_test() {
return src(['test/session.spec.js'], {read: false})
.pipe(mocha({timeout: 2000}));
};
function mailer_test() {
return src(['test/mailer.spec.js'], {read: false})
.pipe(mocha({timeout: 2000}));
};
function user_test() {
return src(['test/user.spec.js'], {read: false})
.pipe(mocha({timeout: 2000}));
};
// depends on user-test
function final_test() {
return src(['test/test.js'], {read: false})
.pipe(mocha({timeout: 2000}));
};
exports.default = series(lint, middleware_test, dbauth_test, session_test, user_test, final_test);