-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgulpfile.js
More file actions
41 lines (34 loc) · 1.07 KB
/
Copy pathgulpfile.js
File metadata and controls
41 lines (34 loc) · 1.07 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
var gulp = require('gulp');
var gutil = require('gulp-util');
// var spawn = require('child_process').spawn;
// var phantom = require('gulp-phantom');
var istanbul = require('gulp-istanbul');
var mocha = require('gulp-mocha');
var mochaPhantomJS = require('gulp-mocha-phantomjs');
var lcov = require('mocha-lcov-reporter');
var testDirs = ['./basic', './dom', './backbone'];
var notSpec = function ( dir ) {
return dir + '/**/!(*-spec.js)+(*.js)';
};
gulp.task('test', function(cb){
gulp.src( testDirs.map( notSpec ) )
.pipe(istanbul())
.on('finish', function(){
gulp.src([
'./basic/*-spec.js',
'./dom/*-spec.js',
// './backbone/test.html'
])
.pipe(mocha({reporter: 'spec'}))
// .pipe(mochaPhantomJS({reporter: 'spec'}))
.pipe(istanbul.writeReports())
.on('end', cb);
});
});
// gulp.task('backbone', function(cb){
// gulp.src('./backbone/test.html')
// .pipe(mochaPhantomJS({reporter: 'spec'}))
// .pipe(istanbul.writeReports())
// .on('end', cb);
// });
gulp.task('default', ['test']);