在你的gulp
文件中,用你的gulp测试任务中的
错误回调替换“throw err”和“this.emit(‘end’)”.
- gulp.task('test',function() {
- return gulp.src(testFiles)
- .pipe(karma({
- configFile: 'karma.conf.js',action: 'run'
- }))
- .on('error',function(err) {
- throw err;
- });
- });
所以你的测试任务现在看起来像;
- gulp.task('test',function(err) {
- this.emit('end');
- });
- });