-
Notifications
You must be signed in to change notification settings - Fork 123
/
gulpfile.js
53 lines (46 loc) · 1.04 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
46
47
48
49
50
51
52
53
var _ = require('lodash');
var gulp = require('gulp');
var argv = require('yargs').argv;
var runSequence = require('run-sequence');
var eslint = require('gulp-eslint');
var mocha = require('gulp-mocha');
var mochaPhantomJS = require('gulp-mocha-phantomjs');
/**
* Linters
*/
gulp.task('lint.eslint', function() {
return gulp.src([
'src/**/*.js',
'demo/**/*.js',
'test/**/*.js',
'!test/webpack/*.js',
'!demo/baron.js'
])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('lint', ['lint.eslint']);
/**
* Tests
*/
gulp.task('test', function() {
return gulp.src(['test/*.auto.html'])
.pipe(mochaPhantomJS({
phantomjs: {
viewportSize: {
width: 1024,
height: 768
}
}
}));
});
gulp.task('unit', function() {
return gulp.src([
'test/**/*.spec.js'
], {read: false})
.pipe(mocha());
});
gulp.task('t', function(cb) {
runSequence('lint', 'test', 'unit', cb);
});