-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathgulpfile.js
More file actions
34 lines (29 loc) · 822 Bytes
/
Copy pathgulpfile.js
File metadata and controls
34 lines (29 loc) · 822 Bytes
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
'use strict';
const gulp = require('gulp');
const uglify = require('gulp-uglify');
const mocha = require('gulp-mocha');
const istanbul = require('gulp-istanbul');
// Uglify Task
// Minifies JavaScript files
gulp.task('uglify', () => {
return gulp.src('app/*.js')
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('default', ['uglify']);
gulp.task('code-coverage', () => {
return gulp.src(['app/**/*.js'])
.pipe(istanbul({
includeUntested: true
}))
.pipe(istanbul.hookRequire());
});
gulp.task('test', ['code-coverage'], () => {
return gulp.src(['specs/**/*.js'])
.pipe(mocha({reporter: 'nyan'}))
.pipe(istanbul.writeReports({
dir: './coverage',
reporters: [ 'lcov', 'json', 'text', 'text-summary' ],
reportOpts: { dir: './coverage' }
}));
});