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 | 1 1 1 1 1 1 1 1 1 | var gulp = require('gulp'); var jshint = require('gulp-jshint'); var mocha = require('gulp-mocha'); var paths = { scripts: ['**/*.js', '!node_modules/**', '!coverage/**'], tests: 'test/**.*js' }; gulp.task('jshint', function () { return gulp .src(paths.scripts) .pipe(jshint()) .pipe(jshint.reporter('default')) .pipe(jshint.reporter('fail')); }); gulp.task('test', ['jshint'], function () { return gulp .src(paths.tests) .pipe(mocha({reporter: 'spec'})); }); gulp.task('default', ['test']); |