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

Function addErrorToEachTestUnderDescribe

packages/jest-circus/src/utils.ts:480–495  ·  view source on GitHub ↗
(
  describeBlock: Circus.DescribeBlock,
  error: Circus.Exception,
  asyncError: Circus.Exception,
)

Source from the content-addressed store, hash-verified

478 formatErrorStackWithCause(error, new Set());
479
480export const addErrorToEachTestUnderDescribe = (
481 describeBlock: Circus.DescribeBlock,
482 error: Circus.Exception,
483 asyncError: Circus.Exception,
484): void => {
485 for (const child of describeBlock.children) {
486 switch (child.type) {
487 case 'describeBlock':
488 addErrorToEachTestUnderDescribe(child, error, asyncError);
489 break;
490 case 'test':
491 child.errors.push([error, asyncError]);
492 break;
493 }
494 }
495};
496
497type TestDescription = {
498 ancestorTitles: Array<string>;

Callers 2

eventHandlerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected