Issue running karma task from gulp

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

    How are you running your tests with Gulp? I came up against this issue recently on OSX, running node v0.11.14 and gulp 3.8.10, whenever there were failing tests.

    Changing from the recommended:

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

    To:

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

    ...got rid of this error.

    Seems to be down to how gulp handles error messages when an error is signalled in a callback. See Improve error messages on exit for more information.

提交回复
热议问题