Skip to content

Commit

Permalink
make mocha exit properly
Browse files Browse the repository at this point in the history
  • Loading branch information
joelanman committed Nov 3, 2016
1 parent e86546b commit 574e720
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions gulp/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

var gulp = require('gulp')
var gutil = require('gulp-util')
var mocha = require('gulp-mocha')
var runSequence = require('run-sequence')

Expand Down Expand Up @@ -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()
})
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 574e720

Please sign in to comment.