Move all core files into src/core.
Move Browser & Node specs to test against lib/jasmine.js instead of the separate source. Yes, this makes development a little harder but it's better to test that jasmine.js was built correctly.
This commit is contained in:
35
src/core/MultiReporter.js
Normal file
35
src/core/MultiReporter.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* @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);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user