Reset the env state between parallel batches
This commit is contained in:
@@ -499,6 +499,11 @@ getJasmineRequireObj().Env = function(j$) {
|
||||
reportSpecDone
|
||||
});
|
||||
|
||||
this.parallelReset = function() {
|
||||
// TODO: ensure that autoCleanClosures was false
|
||||
suiteBuilder.parallelReset();
|
||||
};
|
||||
|
||||
/**
|
||||
* Executes the specs.
|
||||
*
|
||||
|
||||
@@ -2,6 +2,7 @@ getJasmineRequireObj().Runner = function(j$) {
|
||||
class Runner {
|
||||
constructor(options) {
|
||||
this.topSuite_ = options.topSuite;
|
||||
// TODO use names that read like getters
|
||||
this.totalSpecsDefined_ = options.totalSpecsDefined;
|
||||
this.focusedRunables_ = options.focusedRunables;
|
||||
this.runableResources_ = options.runableResources;
|
||||
|
||||
@@ -132,6 +132,10 @@ getJasmineRequireObj().Suite = function(j$) {
|
||||
this.reportedDone = false;
|
||||
};
|
||||
|
||||
Suite.prototype.removeChildren = function() {
|
||||
this.children = [];
|
||||
};
|
||||
|
||||
Suite.prototype.addChild = function(child) {
|
||||
this.children.push(child);
|
||||
};
|
||||
|
||||
@@ -22,6 +22,12 @@ getJasmineRequireObj().SuiteBuilder = function(j$) {
|
||||
this.focusedRunables = [];
|
||||
}
|
||||
|
||||
parallelReset() {
|
||||
this.topSuite.removeChildren();
|
||||
this.totalSpecsDefined = 0;
|
||||
this.focusedRunables = [];
|
||||
}
|
||||
|
||||
describe(description, definitionFn) {
|
||||
ensureIsFunction(definitionFn, 'describe');
|
||||
const suite = this.suiteFactory_(description);
|
||||
|
||||
Reference in New Issue
Block a user