MCPcopy
hub / github.com/jestjs/jest / addExpectationResult

Method addExpectationResult

packages/jest-jasmine2/src/jasmine/Spec.ts:159–174  ·  view source on GitHub ↗
(
    passed: boolean,
    data: ExpectationResultFactoryOptions,
    isError?: boolean,
  )

Source from the content-addressed store, hash-verified

157 }
158
159 addExpectationResult(
160 passed: boolean,
161 data: ExpectationResultFactoryOptions,
162 isError?: boolean,
163 ) {
164 const expectationResult = expectationResultFactory(data, this.initError);
165 if (passed) {
166 this.result.passedExpectations.push(expectationResult);
167 } else {
168 this.result.failedExpectations.push(expectationResult);
169
170 if (this.throwOnExpectationFailure && !isError) {
171 throw new ExpectationFailed();
172 }
173 }
174 }
175
176 execute(onComplete?: () => void, enabled?: boolean) {
177 // eslint-disable-next-line @typescript-eslint/no-this-alias

Callers 3

onExceptionMethod · 0.95
constructorMethod · 0.45
Suite.test.tsFile · 0.45

Calls 1

expectationResultFactoryFunction · 0.85

Tested by

no test coverage detected