mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
36 lines
932 B
JavaScript
36 lines
932 B
JavaScript
/**
|
|
* @constructor
|
|
*/
|
|
jasmine.MultiReporter = function() {
|
|
this.subReporters_ = [];
|
|
};
|
|
jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter);
|
|
|
|
jasmine.MultiReporter.prototype.addReporter = function(reporter) {
|
|
this.subReporters_.push(reporter);
|
|
};
|
|
|
|
(function() {
|
|
var functionNames = [
|
|
"reportRunnerStarting",
|
|
"reportRunnerResults",
|
|
"reportSuiteResults",
|
|
"reportSpecStarting",
|
|
"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++) {
|
|
var subReporter = this.subReporters_[j];
|
|
if (subReporter[functionName]) {
|
|
subReporter[functionName].apply(subReporter, arguments);
|
|
}
|
|
}
|
|
};
|
|
})(functionName);
|
|
}
|
|
})();
|