Created
June 30, 2015 18:32
-
-
Save Johannestegner/b85b719a31887b3cbd4b to your computer and use it in GitHub Desktop.
Continual Tasks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @constructor | |
*/ | |
var ConsoleNotifier = function ConsoleNotifier() { }; | |
/** | |
* Fetches the name of the notifier. | |
* @returns {string} Notifier name. | |
*/ | |
ConsoleNotifier.prototype.getName = function () { return "ConsoleNotifier"; }; | |
/** | |
* Fetches the version of the notifier - 'x.x.x.x'. | |
* @returns {string} Notifier version. | |
*/ | |
ConsoleNotifier.prototype.getVersion = function () { return "1.0.0.0" }; | |
/** | |
* Notifies with a error. | |
* @param {string} str Error string. | |
* @param {function} callback On done callback. | |
*/ | |
ConsoleNotifier.prototype.sendError = function sendError(str, callback) { | |
// This notifier is quite basic, we just print the message to the console! | |
console.error(str); | |
// Then fire the callback! | |
callback(); | |
}; | |
/** | |
* Notifies with a success message. | |
* @param {string} str Message string. | |
* @param {number} time Time in seconds the execution of test took. | |
* @param {function} callback On done callback. | |
*/ | |
ConsoleNotifier.prototype.sendSuccess = function sendSuccess(str, time, callback) { | |
// This notifier is quite basic, we just print the message to the console! | |
console.log('Job done!'); | |
console.log(str); | |
console.log('Took %d ms to complete.', time); | |
// Then fire the callback! | |
callback(); | |
}; | |
module.exports = new ConsoleNotifier(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment