* Removed old Queue & Runner in favor of Suite using the new QueueRunner
* New reporter interface across all reporters * xdescribe & xit now store disabled specs * Rewrite of HtmlReporter to support new interface and be more performant
This commit is contained in:
committed by
Dan Hansen and Davis W. Frank
parent
05977203a6
commit
3fc79bac9e
30
src/core/ReportDispatcher.js
Normal file
30
src/core/ReportDispatcher.js
Normal file
@@ -0,0 +1,30 @@
|
||||
jasmine.ReportDispatcher = function(methods) {
|
||||
|
||||
var dispatchedMethods = methods || [];
|
||||
|
||||
for (var i = 0; i < dispatchedMethods.length; i++) {
|
||||
var method = dispatchedMethods[i];
|
||||
this[method] = function(m) {
|
||||
return function() {
|
||||
dispatch(m, arguments);
|
||||
};
|
||||
}(method);
|
||||
}
|
||||
|
||||
var reporters = [];
|
||||
|
||||
this.addReporter = function(reporter) {
|
||||
reporters.push(reporter);
|
||||
};
|
||||
|
||||
return this;
|
||||
|
||||
function dispatch(method, args) {
|
||||
for (var i = 0; i < reporters.length; i++) {
|
||||
var reporter = reporters[i];
|
||||
if (reporter[method]) {
|
||||
reporter[method].apply(reporter, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user