-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
43 lines (38 loc) · 1.13 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
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
jshint = require('gulp-jshint'),
nodeunit = require('gulp-nodeunit'),
cover = require('gulp-coverage'),
coveralls = require('gulp-coveralls');
gulp.task('minify-js', function() {
return gulp.src('textural.js')
.pipe(uglify({keepSpecialComments:"1"}))
.pipe(rename({suffix: '.min'}))
.pipe(gulp.dest(''))
});
gulp.task('jshint', function () {
return gulp.src([
'textural.js'
])
.pipe(jshint())
.pipe(jshint.reporter('default', { verbose: true }))
.pipe(jshint.reporter('fail'));
});
gulp.task('unit', function () {
return gulp.src('tests/*.js')
.pipe(cover.instrument({
pattern: ['textural.js']
}))
.pipe(nodeunit({
reporter: 'junit',
reporterOptions: {
output: 'test'
}
}))
.pipe(cover.gather())
.pipe(cover.format({ reporter: 'lcov' }))
.pipe(coveralls());
});
gulp.task('test', ['jshint', 'unit']);
gulp.task('default', ['minify-js', 'test']);