sindresorhus / gulp-mocha

Run Mocha tests
MIT License
375 stars 91 forks source link

Downstream tasks aren't firing #158

Closed axlj45 closed 7 years ago

axlj45 commented 7 years ago

The following configuration worked in 3.0.1:

gulp.task('mocha', ['pre-test'], (done) => {
    let error;
    gulp.src(paths.unitTests)
        .pipe($.mocha())
        .on('end', () => done(error))
        .on('error', (err) => { error = err; });
});

In 4.0.1, the end event is never emitted so downstream tasks aren't firing. The test event, _result works, but I imagine that this isn't reliable.

Thanks!

sindresorhus commented 7 years ago

Try the finish event, although the correct solution would be to return the gulp.src instead of using the callback (done).