-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
48 lines (42 loc) · 1.38 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
47
48
"use strict";
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var jasmine = require('gulp-jasmine');
var istanbul = require('gulp-istanbul');
var coveralls = require('mwittig-gulp-coveralls');
var replace = require('gulp-replace');
var rename = require('gulp-rename');
var print = require('gulp-print');
gulp.task('pre-test', function () {
return gulp.src(['src/**/*.js'])
.pipe(plumber())
.pipe(istanbul({includeUntested: true}))
.pipe(istanbul.hookRequire());
});
gulp.task('test', ['pre-test'], function () {
//process.env.MILIGHT_DEBUG = true;
return gulp.src(['test/v6.js', 'test/legacy.js'])
.pipe(plumber())
.pipe(jasmine({
verbose: false,
includeStackTrace: true
}))
.pipe(istanbul.writeReports({
dir: './coverage',
reporters: ['lcov', 'json', 'text', 'text-summary'],
reportOpts: {dir: './coverage'}
}))
.pipe(istanbul.enforceThresholds({ thresholds: { global: 50 } }));
});
gulp.task('coveralls', function () {
return gulp.src('./coverage/**/lcov.info')
.pipe(coveralls())
});
gulp.task('build', function() {
return gulp.src(['src/commands.js'])
.pipe(replace(/,\s{0,}0x55/g, ''))
.pipe(print())
.pipe(rename('commands2.js'))
.pipe(gulp.dest('src'))
});
gulp.task('default', ['test']);