Gulp:错误:未处理的“错误”事件。 (1)当phpunit测试失败时

时间:2019-03-22 22:44:19

标签: javascript gulp phpunit

我正在尝试使用gulp自动运行phpunit。当phpunit测试失败时,我在终端中看到以下错误(所有通过的测试均不会导致该错误):

FAILURES!
Tests: 1, Assertions: 1, Failures: 1.

events.js:188
      throw err;
      ^

Error: Unhandled "error" event. (1)
    at Domain.emit (events.js:186:19)
    at Stream.emit (events.js:181:14)
    at Stream.onerror (/var/www/html/wptest2/node_modules/readable-stream/lib/_stream_readable.js:640:52)
    at emitOne (events.js:116:13)
    at Stream.emit (events.js:211:7)
    at next (/var/www/html/wptest2/node_modules/map-stream/index.js:74:19)
    at /var/www/html/wptest2/node_modules/map-stream/index.js:84:7
    at /var/www/html/wptest2/node_modules/gulp-phpunit/index.js:341:17
    at /var/www/html/wptest2/node_modules/shelljs/src/exec.js:204:9
    at ChildProcess.exithandler (child_process.js:282:5)

Gulpfile.js:

var gulp = require('gulp'),
    connect = require('gulp-connect-php'),
    gulpPhpunit = require('gulp-phpunit');

gulp.task('gulpPhpunit', function(done) {
  var options = {debug: false};
  gulp.src('phpunit.xml')
      .pipe(gulpPhpunit('./vendor/bin/phpunit', options));

  done();
});

gulp.task("default", gulp.series('gulpPhpunit'));

有人知道如何解决吗?

0 个答案:

没有答案