pocesar / grunt-mocha-istanbul

Almost config-free Istanbul code coverage reporter for Mocha usage in Grunt
MIT License
75 stars 23 forks source link

Done callback never called in certain situations #32

Closed petuomin closed 9 years ago

petuomin commented 9 years ago

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.

pocesar commented 9 years ago

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 
[...]
petuomin commented 9 years ago

Oops. Indeed. :)

Thanks for the quick reply.