-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
37 lines (30 loc) · 921 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
(function() {
'use strict';
var gulp = require('gulp');
var mocha = require('gulp-mocha');
gulp.task('default', ['unit-tests', 'watch']);
gulp.task('watch', function() {
gulp.watch('app/**/*.js', ['unit-tests']);
gulp.watch('tests/**/*.spec.js', ['unit-tests']);
});
gulp.task('unit-tests', function() {
return gulp.src(['tests/**/*.spec.js'],
{read: false})
.pipe(mocha(
{
reporter: 'spec' // 'landing' 'nyan' 'spec' 'dot' 'progress'
}));
/*
https://github.com/sindresorhus/gulp-mocha
If your test suite is not exiting it might be because you still have a lingering callback,
most often caused by an open database connection.
You should close this connection or do the following:
.once('error', function () {
process.exit(1);
})
.once('end', function () {
process.exit();
});
*/
});
})();