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 d256dd4880..4109de8c4a 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",