pocesar/grunt-mocha-istanbul

Done callback never called in certain situations

Closed this issue · 2 comments

On lines 288-291:

grunt.event.emit('coverage', coverage, function (d) {
  grunt.log.ok(result || 'Done. Check coverage folder.'); 
  done(d);
});

The module emits a coverage event with coverage data and a callback. If there are no listeners executing that callback, done will never be called.

yup, that's by design. if you set coverage: true in your options, you must provide a grunt.event.on('coverage', ... as stated in the README https://github.com/pocesar/grunt-mocha-istanbul#boolean-optionscoverage-default-false

[...] 
and you must manually call done() when you are finished, else the grunt task will hang 
[...]

Oops. Indeed. :)

Thanks for the quick reply.