0.0.1 • Published 7 years ago

mocha-custom-reporter v0.0.1

Weekly downloads
41
License
-
Repository
-
Last release
7 years ago

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');
		}
}

Events supported: onStart, onPending, onPass, onFail, onEnd.