Add reportRunnerStarting callback to reporters.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -5,6 +5,10 @@
|
||||
jasmine.Reporter = function() {
|
||||
};
|
||||
|
||||
//noinspection JSUnusedLocalSymbols
|
||||
jasmine.Reporter.prototype.reportRunnerStarting = function(runner) {
|
||||
};
|
||||
|
||||
//noinspection JSUnusedLocalSymbols
|
||||
jasmine.Reporter.prototype.reportRunnerResults = function(runner) {
|
||||
};
|
||||
|
||||
@@ -11,6 +11,13 @@ jasmine.Runner = function(env) {
|
||||
};
|
||||
jasmine.util.inherit(jasmine.Runner, jasmine.ActionCollection);
|
||||
|
||||
jasmine.Runner.prototype.execute = function() {
|
||||
if (this.env.reporter.reportRunnerStarting) {
|
||||
this.env.reporter.reportRunnerStarting(this);
|
||||
}
|
||||
jasmine.ActionCollection.prototype.execute.call(this);
|
||||
};
|
||||
|
||||
jasmine.Runner.prototype.finishCallback = function() {
|
||||
this.env.reporter.reportRunnerResults(this);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user