Skip to content

Instantly share code, notes, and snippets.

@jouni-kantola
Last active August 29, 2015 14:18
Show Gist options
  • Save jouni-kantola/8c12919d049b8b4b91fd to your computer and use it in GitHub Desktop.
Save jouni-kantola/8c12919d049b8b4b91fd to your computer and use it in GitHub Desktop.
mocha reporter for Asimov
function AsimovReporter(runner) {
var passes = 0,
failures = 0;
runner.on('pass', function(test) {
passes++;
console.log('##asimov-deploy[test="%s" pass="true"', test.fullTitle());
});
runner.on('fail', function(test, err) {
failures++;
console.log('##asimov-deploy[test="%s" pass="false" reason="%s"', test.fullTitle(), err.message);
});
runner.on('end', function() {
console.log('end: %d/%d', passes, passes + failures);
process.exit(failures);
});
}
module.exports = AsimovReporter;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment