Add reportRunnerStarting callback to reporters.

This commit is contained in:
Christian Williams
2009-07-08 18:33:15 -07:00
parent e1408a9f58
commit f451e633cb
7 changed files with 220 additions and 170 deletions

View File

@@ -11,13 +11,16 @@ jasmine.MultiReporter.prototype.addReporter = function(reporter) {
};
(function() {
var functionNames = ["reportRunnerResults", "reportSuiteResults", "reportSpecResults", "log"];
var functionNames = ["reportRunnerStarting", "reportRunnerResults", "reportSuiteResults", "reportSpecResults", "log"];
for (var i = 0; i < functionNames.length; i++) {
var functionName = functionNames[i];
jasmine.MultiReporter.prototype[functionName] = (function(functionName) {
return function() {
for (var j = 0; j < this.subReporters_.length; j++) {
this.subReporters_[j][functionName].apply(this.subReporters_[j], arguments);
var subReporter = this.subReporters_[j];
if (subReporter[functionName]) {
subReporter[functionName].apply(subReporter, arguments);
}
}
};
})(functionName);