-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (41 loc) · 1.25 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
44
45
46
var gulp = require('gulp');
var karma = require('karma').server;
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
gulp.task('test', function(done) {
karma.start({
frameworks: ['mocha', 'expect', 'commonjs'],
files: ['src/*.js', 'test/*spec.js'],
preprocessors: {
'src/**/*.js': ['coverage', 'commonjs'],
'test/**/*.spec.js': ['commonjs']
},
browsers: ['Firefox'],
singleRun: true,
reporters: ['dots', 'coverage'],
coverageReporter: {
type : 'lcovonly',
dir : 'dist/coverage/'
}
}, done);
});
gulp.task('tdd', function(done) {
karma.start({
frameworks: ['mocha', 'expect', 'commonjs'],
files: ['src/*.js', 'test/*spec.js'],
preprocessors: {
'src/**/*.js': ['commonjs'],
'test/**/*.js': ['commonjs']
},
browsers: ['Chrome'],
reporters: ['progress']
}, done);
});
gulp.task('default', ['test'], function () {
gulp.src('src/*.js')
.pipe(concat('ex-manipulator.js'))
.pipe(gulp.dest('dist'))
.pipe(uglify()).pipe(rename('ex-manipulator.min.js'))
.pipe(gulp.dest('dist'));
});