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

Function buildExecError

packages/jest-core/src/TestScheduler.ts:514–526  ·  view source on GitHub ↗
(err: unknown)

Source from the content-addressed store, hash-verified

512};
513
514const buildExecError = (err: unknown): SerializableError => {
515 if (typeof err === 'string' || err == null) {
516 return strToError(err || 'Error');
517 }
518 const anyErr = err as any;
519 if (typeof anyErr.message === 'string') {
520 if (typeof anyErr.stack === 'string' && anyErr.stack.length > 0) {
521 return anyErr;
522 }
523 return strToError(anyErr.message);
524 }
525 return strToError(JSON.stringify(err));
526};
527
528function stableRunnerOptionsKey(
529 options: Record<string, unknown> | undefined,

Callers 1

scheduleTestsMethod · 0.85

Calls 1

strToErrorFunction · 0.85

Tested by

no test coverage detected