Issue running karma task from gulp

前端 未结 10 2415
隐瞒了意图╮
隐瞒了意图╮ 2020-12-25 09:44

I am trying to run karma tests from gulp task and I am getting this error:

Error: 1
   at formatError (C:\\Users\\Tim\\AppData\\Roaming\\npm\\node_modules\\g         


        
10条回答
  •  情深已故
    2020-12-25 09:55

    The right way to solve this according to Karma's documentation and https://github.com/pkozlowski-opensource, is to rely on Karma's watch mechanism rather than Gulp's:

    gulp.task('tdd', function (done) {
      karma.start({
        configFile: __dirname + '/karma.conf.js'
      }, done);
    });
    

    Note the omission of singleRun: true.

    @McDamon's workaround will work for gulp.watch, but you don't want to swallow exit codes like that when running on a CI server.

    Gulp is also reworking how they handle exit codes in scenarios just like this one. See https://github.com/gulpjs/gulp/issues/71 and the other dozen or so related issues.

提交回复
热议问题