Skip to content

Commit

Permalink
run test-ci tasks in sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
Hovhannes Babayan committed Dec 24, 2014
1 parent cdf54a4 commit 69ce630
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,30 @@ var gulp = require('gulp');
const BUILD_DIR = './dist/';
const COVERAGE_DIR = 'coverage';

gulp.task('default', ['clean', 'build']);
gulp.task('default', ['build']);

/**
* Empties BUILD_DIR and all generated files
* Empties BUILD_DIR
*/
gulp.task('clean', function(cb) {
gulp.task('clean', ['clean-coverage'], function(cb) {
var del = require('del');
del([BUILD_DIR + '*', COVERAGE_DIR], cb);
});

/**
* Cleans coverage data
*/
gulp.task('clean-coverage', function(cb) {
var del = require('del');
del([COVERAGE_DIR], cb);
});


/**
* Generates browser-ready version for API in BUILD_DIR
* File will be named as api.js
*/
gulp.task('build', function() {
gulp.task('build', ['clean'], function() {
var browserify = require('browserify');
var source = require('vinyl-source-stream');
return browserify(
Expand Down Expand Up @@ -53,7 +62,7 @@ var runMocha = function() {

gulp.task('test', runMocha);

gulp.task('test-coverage', function(cb) {
gulp.task('test-coverage', ['clean-coverage'], function(cb) {
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');

Expand All @@ -67,10 +76,8 @@ gulp.task('test-coverage', function(cb) {
});
});

gulp.task('test-coveralls', function() {
gulp.task('test-ci', ['test-coverage'], function() {
var coveralls = require('gulp-coveralls');
return gulp.src(COVERAGE_DIR + '/lcov.info')
.pipe(coveralls());
});

gulp.task('test-ci', ['clean', 'test-coverage', 'test-coveralls']);

0 comments on commit 69ce630

Please sign in to comment.