Allow currently registered reporters to be cleared

- jasmine/jasmine-npm#88
This commit is contained in:
Gregg Van Hove
2016-09-16 16:01:26 -07:00
parent ed31b9b844
commit 04bb56a5b5
4 changed files with 32 additions and 3 deletions

View File

@@ -278,6 +278,10 @@ getJasmineRequireObj().Env = function(j$) {
reporter.provideFallbackReporter(reporterToAdd);
};
this.clearReporters = function() {
reporter.clearReporters();
};
var spyRegistry = new j$.SpyRegistry({currentSpies: function() {
if(!currentRunnable()) {
throw new Error('Spies must be created in a before function or a spec');

View File

@@ -18,11 +18,14 @@ getJasmineRequireObj().ReportDispatcher = function() {
this.addReporter = function(reporter) {
reporters.push(reporter);
};
this.provideFallbackReporter = function(reporter) {
fallbackReporter = reporter;
};
this.clearReporters = function() {
reporters = [];
};
return this;