-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
56 lines (48 loc) · 1.41 KB
/
gulpfile.js
File metadata and controls
56 lines (48 loc) · 1.41 KB
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
55
56
const gulp = require('gulp');
const istanbul = require('gulp-istanbul');
const mocha = require('gulp-mocha');
const nodemon = require('gulp-nodemon');
const async = () => {
return Promise.resolve();
};
const config = require('./config');
gulp.task('server', () => {
async().then(() => require('./app/db').init(config.connectionString))
.then((db) => require('./app/data').init(db))
.then((data) => require('./app').init(data))
.then((app) => {
app.listen(config.port,
() => console.log(`It Works at: ${config.port}`));
})
.catch((err) => {
console.log(err);
});
});
gulp.task('dev', ['server'], () => {
return nodemon({
ext: 'js',
task: ['server'],
script: 'server.js',
});
});
gulp.task('pre-test', () => {
return gulp.src(['./app/**/*.js', './models/*.js'])
.pipe(istanbul({
includeUntested: true,
}))
.pipe(istanbul.hookRequire());
});
gulp.task('alltests', ['pre-test'], () => {
return gulp.src(['./tests/unit/**/*.js', './tests/integration/**/*.js'])
.pipe(mocha({
reporter: 'nyan',
}))
.pipe(istanbul.writeReports());
});
gulp.task('unittests', ['pre-test'], () => {
return gulp.src(['./tests/unit/**/*.js'])
.pipe(mocha({
reporter: 'nyan',
}))
.pipe(istanbul.writeReports());
});