Issue running karma task from gulp

前端 未结 10 2376
隐瞒了意图╮
隐瞒了意图╮ 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 10:10

    If you want to return with an error code, and want to see Karma's error output but not Gulp's (probably unrelated) stack trace:

    gulp.task('test', function() {
        karma.start({
            configFile: __dirname + '/karma.conf.js',
            singleRun: true
        }, function(karmaExitStatus) {
               if (karmaExitStatus) {
                   process.exit(1);
               }
        });
    });
    

提交回复
热议问题