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

Method onFailure

packages/jest-core/src/TestScheduler.ts:185–202  ·  view source on GitHub ↗
(test: Test, error: SerializableError)

Source from the content-addressed store, hash-verified

183 };
184
185 const onFailure = async (test: Test, error: SerializableError) => {
186 if (watcher.isInterrupted()) {
187 return;
188 }
189 const testResult = buildFailureTestResult(test.path, error);
190 testResult.failureMessage = formatExecError(
191 testResult.testExecError,
192 test.context.config,
193 this._globalConfig,
194 test.path,
195 );
196 addResult(aggregatedResults, testResult);
197 await this._dispatcher.onTestFileResult(
198 test,
199 testResult,
200 aggregatedResults,
201 );
202 };
203
204 const updateSnapshotState = async () => {
205 const contextsWithSnapshotResolvers = await Promise.all(

Callers

nothing calls this directly

Calls 5

buildFailureTestResultFunction · 0.90
formatExecErrorFunction · 0.90
addResultFunction · 0.90
isInterruptedMethod · 0.80
onTestFileResultMethod · 0.45

Tested by

no test coverage detected