mocha-custom-reporter
v0.0.1
Published
Adds custom events for mocha runner
Downloads
3
Readme
mocha-custom-reporter
To execute custom functions simply add reporter in
mochaOpts.reporter = 'mocha-custom-reporter'
and create global array onFail that contains custom functions to execute on every fail.
Example:
onPrepare: function () {
global.onFail = [require('path_to_your_function'), anotherFail];
function anotherFail(test, err) {
console.log('\nTest failed - ' + test.title);
console.log('Error:' + err + '\n');
}
}