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

Function handleError

packages/expect/src/index.ts:353–365  ·  view source on GitHub ↗
(error: Error)

Source from the content-addressed store, hash-verified

351 };
352
353 const handleError = (error: Error) => {
354 if (
355 matcher[INTERNAL_MATCHER_FLAG] === true &&
356 !(error instanceof JestAssertionError) &&
357 error.name !== 'PrettyFormatPluginError' &&
358 // Guard for some environments (browsers) that do not support this feature.
359 Error.captureStackTrace
360 ) {
361 // Try to remove this and deeper functions from the stack trace frame.
362 Error.captureStackTrace(error, throwingMatcher);
363 }
364 throw error;
365 };
366
367 let potentialResult: ExpectationResult;
368

Callers 1

makeThrowingMatcherFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected