pocesar/grunt-mocha-istanbul

If the "check" requirements are not met, the coverage method is never called

Opened this issue · 4 comments

If the "check" requirements are not met, the coverage method is never called.

The problem with this is that it means that you will never get coveralls.io to see your coverage when it's below the required threshold. This is when you would MOST want to be able to see the details of the coverage.

Right now I am having to put check at zero to force it to always go to coveralls.io, but this means that my Travis CI build shows passing when I would in fact like it to be failing when the coverage isn't good enough.

At least make it an option maybe?

does it work with --force? because that's the desired behavior, it should never continue if the coverage threshold isn't met, since it won't generate coverage files if it fails, therefore we could not trigger the coverage event.

this would need to be refactor to allow the coverage files to be created and event emitted regardless of the threshold, but would break current implementations

I thought of that - the problem with --force is that it causes failures to no longer return error codes, and therefore Travis sees everything as successful.

could implement a new option hardFail (that defaults to true), else it will only emit a warning and won't stop further tasks

ngeor commented

Thanks for linking to the issue I opened! Indeed they seem quite similar. Consider calling the new option noFail (that defaults to false).