From c4700fcb7bb4efd9aa09d7cc9b9a620ccdbca201 Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Thu, 25 Feb 2016 19:01:56 +0800 Subject: [PATCH] Fix bug in mocha where next task is executed before mocha callback --- gulpfile.babel.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 9ea0a7f..7d64c17 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -105,8 +105,8 @@ gulp.task('test', callback => { return runSequence('prune', 'mocha', callback); }); -gulp.task('mocha', ['build'], () => { - return gulp.src(PATHS.CLI_DEST_JS) +gulp.task('mocha', ['build'], done => { + gulp.src(PATHS.CLI_DEST_JS) .pipe(istanbul({includeUntested: true})) .on('finish', () => { return gulp.src(PATHS.TEST_DEST_JS, {read: false}) @@ -115,7 +115,10 @@ gulp.task('mocha', ['build'], () => { dir: './coverage', reporters: ['lcov'], reportOpts: {dir: './coverage'} - })); + })) + .on('finish', () => { + done(); + }); }); });