Parallel: Don't allow reporters to be added or removed in worker processes

This commit is contained in:
Steve Gravrock
2022-10-22 09:55:48 -07:00
parent 47c64a86d5
commit ed5e902106
3 changed files with 44 additions and 0 deletions

View File

@@ -549,6 +549,10 @@ getJasmineRequireObj().Env = function(j$) {
* @see custom_reporter
*/
this.addReporter = function(reporterToAdd) {
if (parallelLoadingState) {
throw new Error('Reporters cannot be added via Env in parallel mode');
}
reporter.addReporter(reporterToAdd);
};
@@ -571,6 +575,10 @@ getJasmineRequireObj().Env = function(j$) {
* @function
*/
this.clearReporters = function() {
if (parallelLoadingState) {
throw new Error('Reporters cannot be removed via Env in parallel mode');
}
reporter.clearReporters();
};