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

Function getLabelPrinter

packages/jest-matcher-utils/src/index.ts:503–510  ·  view source on GitHub ↗
(...strings: Array<string>)

Source from the content-addressed store, hash-verified

501type PrintLabel = (string: string) => string;
502
503export const getLabelPrinter = (...strings: Array<string>): PrintLabel => {
504 const maxLength = strings.reduce(
505 (max, string) => Math.max(string.length, max),
506 0,
507 );
508 return (string: string): string =>
509 `${string}: ${' '.repeat(maxLength - string.length)}`;
510};
511
512export const matcherErrorMessage = (
513 hint: string, // assertion returned from call to matcherHint

Callers 6

messageFunction · 0.90
toMatchFunction · 0.90
printSnapshotAndReceivedFunction · 0.90
printDiffOrStringifyFunction · 0.85
index.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected