Call buildExpectationResult directly from Suite and Spec

This removes quite a bit of indirection from result processing, at the
cost of making a few of the tests more awkward.
This commit is contained in:
Steve Gravrock
2022-06-01 09:41:38 -07:00
parent 8e58305b0a
commit 4cc8437f79
8 changed files with 85 additions and 179 deletions

View File

@@ -43,8 +43,6 @@ getJasmineRequireObj().Spec = function(j$) {
function() {
return '';
};
this.expectationResultFactory =
attrs.expectationResultFactory || function() {};
this.onLateError = attrs.onLateError || function() {};
this.queueRunnerFactory = attrs.queueRunnerFactory || function() {};
this.catchingExceptions =
@@ -91,7 +89,7 @@ getJasmineRequireObj().Spec = function(j$) {
}
Spec.prototype.addExpectationResult = function(passed, data, isError) {
const expectationResult = this.expectationResultFactory(data);
const expectationResult = j$.buildExpectationResult(data);
if (passed) {
this.result.passedExpectations.push(expectationResult);
} else {
@@ -296,7 +294,7 @@ getJasmineRequireObj().Spec = function(j$) {
deprecation = { message: deprecation };
}
this.result.deprecationWarnings.push(
this.expectationResultFactory(deprecation)
j$.buildExpectationResult(deprecation)
);
};