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

Function printConstructorName

packages/expect/src/print.ts:120–134  ·  view source on GitHub ↗
(
  label: string,
  constructor: Function,
  isNot: boolean,
  isExpected: boolean,
)

Source from the content-addressed store, hash-verified

118 : `${printConstructorName(label, received, false, false)}\n`;
119
120const printConstructorName = (
121 label: string,
122 constructor: Function,
123 isNot: boolean,
124 isExpected: boolean,
125): string =>
126 typeof constructor.name === 'string'
127 ? constructor.name.length === 0
128 ? `${label} name is an empty string`
129 : `${label}: ${isNot ? (isExpected ? 'not ' : ' ') : ''}${
130 isExpected
131 ? EXPECTED_COLOR(constructor.name)
132 : RECEIVED_COLOR(constructor.name)
133 }`
134 : `${label} name is not a string`;

Calls

no outgoing calls

Tested by

no test coverage detected