-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
37 lines (29 loc) · 962 Bytes
/
gulpfile.js
File metadata and controls
37 lines (29 loc) · 962 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
const gulp = require('gulp');
const jasmine = require('gulp-jasmine');
const istanbul = require('gulp-istanbul');
const codacy = require('gulp-codacy');
//task for codacy coverage integration
gulp.task('codacy', function sendToCodacy() {
return gulp
.src(['coverage/lcov.info'])
.pipe(codacy({
token: 'dfb4448a1ade4ca095025658aa77b8e2'
}));
});
//prepare file for coverage
gulp.task('pre-test', function () {
return gulp.src(['app/**/*.js'])
// Covering files
.pipe(istanbul())
// Force `require` to return covered files
.pipe(istanbul.hookRequire());
})
//unit test task
.task('test', ['pre-test'], function () {
gulp.src('spec/unit/**/*.spec.js').pipe(jasmine()).pipe(istanbul.writeReports());
})
//integration test task
.task('it', function () {
gulp.src('spec/it/**/*.spec.js').pipe(jasmine());
});
gulp.task('default', ['test','it', 'codacy']);