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:
@@ -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)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user