Merge branch 'fallback-report' of https://github.com/mauricioborges/jasmine into mauricioborges-fallback-report
- Merges #1009
This commit is contained in:
@@ -262,6 +262,10 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
reporter.addReporter(reporterToAdd);
|
||||
};
|
||||
|
||||
this.provideFallbackReporter = function(reporterToAdd) {
|
||||
reporter.provideFallbackReporter(reporterToAdd);
|
||||
};
|
||||
|
||||
var spyRegistry = new j$.SpyRegistry({currentSpies: function() {
|
||||
if(!currentRunnable()) {
|
||||
throw new Error('Spies must be created in a before function or a spec');
|
||||
|
||||
@@ -13,14 +13,23 @@ getJasmineRequireObj().ReportDispatcher = function() {
|
||||
}
|
||||
|
||||
var reporters = [];
|
||||
var fallbackReporter = null;
|
||||
|
||||
this.addReporter = function(reporter) {
|
||||
reporters.push(reporter);
|
||||
};
|
||||
|
||||
this.provideFallbackReporter = function(reporter) {
|
||||
fallbackReporter = reporter;
|
||||
};
|
||||
|
||||
|
||||
return this;
|
||||
|
||||
function dispatch(method, args) {
|
||||
if (reporters.length === 0 && fallbackReporter !== null) {
|
||||
reporters.push(fallbackReporter);
|
||||
}
|
||||
for (var i = 0; i < reporters.length; i++) {
|
||||
var reporter = reporters[i];
|
||||
if (reporter[method]) {
|
||||
|
||||
Reference in New Issue
Block a user