-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
67 lines (56 loc) · 1.76 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
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* Copyright (c) 2015 airbug Inc. http://airbug.com
*
* bugcore may be freely distributed under the MIT license.
*/
//-------------------------------------------------------------------------------
// Requires
//-------------------------------------------------------------------------------
var gulp = require('gulp');
var eslint = require('gulp-eslint');
var jest = require('gulp-jest');
var gulpUtil = require('gulp-util');
//-------------------------------------------------------------------------------
// Gulp Tasks
//-------------------------------------------------------------------------------
gulp.task('default', function() {
return gulp.src(['libraries/bugcore/js/**/*.js','!node_modules/**']);
});
gulp.task('lint', function () {
return gulp.src([
'libraries/bugcore/js/**/*.js',
'!node_modules/**'
])
.pipe(eslint())
.pipe(eslint.formatEach())
.pipe(eslint.failOnError())
.on('error', function(error) {
gulpUtil.log('Stream Exiting With Error');
});
});
gulp.task('lint-watch', function() {
var lintAndPrint = eslint();
lintAndPrint.pipe(eslint.formatEach());
return gulp.watch('libraries/bugpack-api/js/**/*.js', function(event) {
if (event.type !== 'deleted') {
gulp.src(event.path)
.pipe(lintAndPrint, {end: false});
}
});
});
gulp.task('test', function () {
return gulp.src('libraries/bugpack-api/js').pipe(jest({
unmockedModulePathPatterns: [
],
testDirectoryName: 'test',
testFileExtensions: [
'js'
],
testPathIgnorePatterns: [
'node_modules'
],
moduleFileExtensions: [
'js'
]
}));
});