Move spec begin and end handling from Env/SuiteBuilder to TreeRunner

This commit is contained in:
Steve Gravrock
2025-08-20 20:53:18 -07:00
parent 759a867094
commit 164a393932
11 changed files with 398 additions and 224 deletions

View File

@@ -477,8 +477,6 @@ getJasmineRequireObj().Env = function(j$) {
expectationFactory,
asyncExpectationFactory,
onLateError: recordLateError,
specResultCallback,
specStarted,
runQueue
});
topSuite = suiteBuilder.topSuite;
@@ -520,8 +518,7 @@ getJasmineRequireObj().Env = function(j$) {
runQueue,
TreeProcessor: j$.TreeProcessor,
globalErrors,
getConfig: () => config,
reportSpecDone
getConfig: () => config
});
this.setParallelLoadingState = function(state) {
@@ -763,28 +760,6 @@ getJasmineRequireObj().Env = function(j$) {
.metadata;
};
function specResultCallback(spec, result, next) {
runableResources.clearForRunable(spec.id);
runner.setCurrentSpec(null);
if (result.status === 'failed') {
runner.hasFailures = true;
}
reportSpecDone(spec, result, next);
}
function specStarted(spec, suite, next) {
runner.setCurrentSpec(spec);
runableResources.initForRunable(spec.id, suite.id);
reportDispatcher.specStarted(spec.result).then(next);
}
function reportSpecDone(spec, result, next) {
spec.reportedDone = true;
reportDispatcher.specDone(result).then(next);
}
this.it = function(description, fn, timeout) {
ensureIsNotNested('it');
const filename = callerCallerFilename();