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

Function matcherErrorMessage

packages/jest-matcher-utils/src/index.ts:512–519  ·  view source on GitHub ↗
(
  hint: string, // assertion returned from call to matcherHint
  generic: string, // condition which correct value must fulfill
  specific?: string, // incorrect value returned from call to printWithType
)

Source from the content-addressed store, hash-verified

510};
511
512export const matcherErrorMessage = (
513 hint: string, // assertion returned from call to matcherHint
514 generic: string, // condition which correct value must fulfill
515 specific?: string, // incorrect value returned from call to printWithType
516): string =>
517 `${hint}\n\n${chalk.bold('Matcher error')}: ${generic}${
518 typeof specific === 'string' ? `\n\n${specific}` : ''
519 }`;
520
521// Display assertion for the report when a test fails.
522// New format: rejects/resolves, not, and matcher name have black color

Callers 15

toBeCloseToFunction · 0.90
toBeInstanceOfFunction · 0.90
toContainFunction · 0.90
toContainEqualFunction · 0.90
toHaveLengthFunction · 0.90
toHavePropertyFunction · 0.90
toMatchFunction · 0.90
toMatchObjectFunction · 0.90
createMatcherFunction · 0.90
ensureMockOrSpyFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected