Move invalid order exception throw into TreeProcessor
This commit is contained in:
@@ -122,12 +122,7 @@ getJasmineRequireObj().Runner = function(j$) {
|
||||
return !config.specFilter(spec);
|
||||
}
|
||||
});
|
||||
|
||||
if (!processor.processTree().valid) {
|
||||
throw new Error(
|
||||
'Invalid order: would cause a beforeAll or afterAll to be run multiple times'
|
||||
);
|
||||
}
|
||||
processor.processTree();
|
||||
|
||||
return this.#execute2(runablesToRun, order, processor);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ getJasmineRequireObj().TreeProcessor = function() {
|
||||
}
|
||||
|
||||
if (!this.#stats.valid) {
|
||||
throw 'invalid order';
|
||||
throw new Error('invalid order');
|
||||
}
|
||||
|
||||
const childFns = this.#wrapChildren(this.#tree, 0);
|
||||
@@ -133,6 +133,9 @@ getJasmineRequireObj().TreeProcessor = function() {
|
||||
this.#stats[node.id].segments.length > 1
|
||||
) {
|
||||
this.#stats = { valid: false };
|
||||
throw new Error(
|
||||
'Invalid order: would cause a beforeAll or afterAll to be run multiple times'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user