I am trying to write a simple viewing task that will keep track of my test files, and when compiling their changes and run using gulp-jasmine .
My task:
gulp.task('watch', function () { gulp.watch(['tests/**/[^_]*.ts'], gulp.series(['compile_tests', 'test'])); })
and test task:
gulp.task('test', function(){ return gulp.src('tests/**/[^_]*.spec.js') .pipe( jasmine().on('error', function(error){ console.log(error); this.emit('end'); }) ); });
But if the verified code contains errors such as is not a function or something else, watch for the failures of the task, and I have to restart it again and again. My error handler is not even called. So how can I handle errors correctly?
gulp gulp-watch
SET
source share