forked from ben-tmp/demochat
-
Notifications
You must be signed in to change notification settings - Fork 183
/
gulpfile.js
32 lines (29 loc) · 1.03 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
var gulp = require('gulp');
var istanbul = require('gulp-istanbul');
// We'll use mocha in this example, but any test framework will work
var mocha = require('gulp-mocha');
var debug = require('gulp-debug');
gulp.task('pre-test', function () {
return gulp.src(['app/**/*.js','!app/tests/**/*.spec.js'])
// Covering files
.pipe(istanbul())
// Force `require` to return covered files
.pipe(istanbul.hookRequire());
});
gulp.task('test', ['pre-test'], function () {
console.log('test task')
return gulp.src(['app/tests/*.js'])
.pipe(debug({title: 'unicorn:'}))
.pipe(mocha({timeout:10000}))
// Creating the reports after tests ran
.pipe(istanbul.writeReports())
// Enforce a coverage of at least 90%
//.pipe(istanbul.enforceThresholds({ thresholds: { global: 20} }));
});
gulp.task('integration', function () {
console.log('running integration tests .....')
console.log('done');
return;
// Enforce a coverage of at least 90%
//.pipe(istanbul.enforceThresholds({ thresholds: { global: 20} }));
});