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

@@ -1691,6 +1691,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);
};
@@ -1713,6 +1717,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();
};