aboutsummaryrefslogtreecommitdiff
path: root/node_modules/gulp-gzip/gulpfile.js
blob: 95ce6781af5113c52dac3c0e0a8a8905f3c3eeee (plain)
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
var clean   = require('gulp-clean');
var filter  = require('gulp-filter');
var gulp    = require('gulp');
var mocha   = require('gulp-mocha');
var watch   = require('gulp-watch');
var jshint  = require('gulp-jshint');
var stylish = require('jshint-stylish');

var root = __dirname;

gulp.task('clean', function() {
  gulp.src([
    'examples/*/tmp',
    'test/tmp'
  ]).pipe(clean());
});

gulp.task('lint', function() {
  gulp.src([ 'index.js', 'test/test.js', 'lib/*.js' ])
    .pipe(jshint({ expr: true }))
    .pipe(jshint.reporter(stylish));
});

gulp.task('test', function() {
  // monkeys are fixing `cwd` for `gulp-mocha`
  // node lives in one process/scope/directory
  process.chdir(root);

  gulp.src('test/test.js')
    .pipe(mocha({ reporter: 'spec', timeout: 1000 }))
});

gulp.task('watch', function() {
  watch({
    glob: [ 'index.js', 'lib/*.js' , 'test/test.js' ],
    read: false
  }, ['clean', 'lint', 'test'])
});

gulp.task('default', ['watch']);