forked from LiveSafe/ls-fs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
42 lines (35 loc) · 1.2 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
'use strict';
var _ = require('ls-lodash'),
gulp = require('gulp'),
jshint = require('gulp-jshint'),
jscs = require('gulp-jscs'),
mocha = require('gulp-mocha'),
mergeStream = require('merge-stream'),
lsConfigs = require('ls-default-configs');
gulp.task('default', _.noop);
gulp.task('test', function() {
gulp.start('lint', 'mocha');
});
gulp.task('mocha', function() {
return gulp.src(['test/*.js'], {read: false})
.pipe(mocha());
});
gulp.task('lint', function() {
var jshintTestConfig = _.safeMerge(lsConfigs.jshintrc, {
globals: {
describe: true,
it: true
}
}),
jscsLint = gulp.src(['lib/**/*.js', 'test/**/*.js', './*.js'])
.pipe(jscs(lsConfigs.jscsrc)),
testLint = gulp.src(['test/*.js'])
.pipe(jshint(jshintTestConfig))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail')),
otherLint = gulp.src(['./*.js', 'lib/*.js'])
.pipe(jshint(lsConfigs.jshintrc))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
return mergeStream(testLint, otherLint, jscsLint);
});