You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2020. It is now read-only.
gulp.task('someTests', function () {
gulp.src(filePath).pipe(ava({verbose: true}));
});
I got the error:
The following tasks did not complete: xxxx
Did you forget to signal async completion?
It turns out in 4.0:
Gulp tasks are asynchronous and Gulp uses async-done to wait for the task's completion. Tasks are called with a callback parameter to call to signal completion. Alternatively, Task can return a stream, a promise, a child process or a RxJS observable to signal the end of the task.
Warning: Sync tasks are not supported and your function will never complete if the one of the above strategies is not used to signal completion. However, thrown errors will be caught by Gulp.
This is probably the easiest way for your use case: gulp automatically passes a callback function to your task as its first argument. Just call that function when you're done:
gulp.task('message', function(done) {
console.log("HTTP Server Started");
done();
});
But when I tried to do this:
gulp.task('someTests', function (done) {
gulp.src(filePath).pipe(ava({ verbose: true })).on('end', function () {
done();
});
});
The done function was never being called. I tried several times under different settings of my test file and was not successful. I also put a console.log before the done call, it was never being called, either. So it seems there is no 'end' emitted by pipe(ava({ verbose: true })). But I did not find a way to put a callback into the gulp-ava call.
Is it just me? Or I was doing it the wrong way?
Thanks in advance,
Liwei
The text was updated successfully, but these errors were encountered:
While using Gulp 4.0 to write tests like this:
I got the error:
It turns out in 4.0:
Official doc
And there is a more detailed explanation on SO.
I picked the callback option from that SO answer:
But when I tried to do this:
The done function was never being called. I tried several times under different settings of my test file and was not successful. I also put a console.log before the done call, it was never being called, either. So it seems there is no 'end' emitted by pipe(ava({ verbose: true })). But I did not find a way to put a callback into the gulp-ava call.
Is it just me? Or I was doing it the wrong way?
Thanks in advance,
Liwei
The text was updated successfully, but these errors were encountered: