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

Function shouldPrintDiff

packages/jest-matcher-utils/src/index.ts:399–410  ·  view source on GitHub ↗
(actual: unknown, expected: unknown)

Source from the content-addressed store, hash-verified

397// does not contain more information than the `Expected:` / `Received:` already gives.
398// In those cases, we do not print a diff to make the output shorter and not redundant.
399const shouldPrintDiff = (actual: unknown, expected: unknown) => {
400 if (typeof actual === 'number' && typeof expected === 'number') {
401 return false;
402 }
403 if (typeof actual === 'bigint' && typeof expected === 'bigint') {
404 return false;
405 }
406 if (typeof actual === 'boolean' && typeof expected === 'boolean') {
407 return false;
408 }
409 return true;
410};
411
412export function replaceMatchedToAsymmetricMatcher(
413 replacedExpected: unknown,

Callers 1

diffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected