UNPKG

grs

Version:

github releases stream module.

53 lines (45 loc) 1.16 kB
process.env.NODE_ENV = 'test'; require('should'); var path = require('path'); var gulp = require('gulp'); var gutil = require('gulp-util'); var coffee = require('gulp-coffee'); var coffeelint = require('gulp-coffeelint'); var mocha = require('gulp-mocha'); // Files. var src = 'src/**/*.coffee'; var tests = 'test/*.mocha.js'; // Coffee Lint gulp.task('lint', function() { gulp.src(src) .pipe(coffeelint({ max_line_length: { value: 100 }, indentation: { value: 4 } })) .pipe(coffeelint.reporter()); }); // Compile coffee scripts. gulp.task('coffee', ['lint'], function() { return gulp.src(src) .pipe(coffee({ bare: true }).on('error', gutil.log)) .pipe(gulp.dest('lib')) .on('error', gutil.log); }); // Run tests. gulp.task('mocha', ['coffee'], function() { return gulp.src(tests) .pipe(mocha({ timeout: 10000, reporter: 'spec' })); }); gulp.task('watch', ['coffee'], function() { gulp.watch(src, ['coffee']); }); gulp.task('default', ['coffee']);