From 64efd4a7973db0938ad1c358236ef66d57a1b122 Mon Sep 17 00:00:00 2001 From: Joe Lanman Date: Thu, 20 Oct 2016 19:28:36 +0100 Subject: [PATCH] make mocha exit properly --- gulp/tasks.js | 13 ++++++++----- package.json | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/gulp/tasks.js b/gulp/tasks.js index bab78463d9..08960d7a96 100644 --- a/gulp/tasks.js +++ b/gulp/tasks.js @@ -5,7 +5,6 @@ */ var gulp = require('gulp') -var gutil = require('gulp-util') var mocha = require('gulp-mocha') var runSequence = require('run-sequence') @@ -36,14 +35,18 @@ gulp.task('watch', function (done) { 'watch-assets', done) }) -gulp.task('test', function (done) { +gulp.task('test', function () { runSequence('generate-assets', - 'mocha', - done) + 'mocha') }) gulp.task('mocha', function () { return gulp.src(['test/**/*.js'], { read: false }) .pipe(mocha({ reporter: 'spec' })) - .on('error', gutil.log) + .once('error', () => { + process.exit(1) + }) + .once('end', () => { + process.exit() + }) }) diff --git a/package.json b/package.json index 11175a7082..5d46579ab2 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "scripts": { "start": "node start.js", "lint": "standard", - "test": "mocha && npm run lint" + "test": "gulp test && npm run lint" }, "dependencies": { "basic-auth": "^1.0.3",