MCPcopy
hub / github.com/microsoft/playwright / toEqual

Function toEqual

packages/playwright/src/matchers/expectLibrary.ts:1037–1057  ·  view source on GitHub ↗
(received: unknown, expected: unknown)

Source from the content-addressed store, hash-verified

1035 },
1036
1037 toEqual(received: unknown, expected: unknown) {
1038 const matcherName = 'toEqual';
1039 const options: MatcherHintOptions = { comment: 'deep equality', isNot: this.isNot, promise: this.promise };
1040
1041 const pass = equals(received, expected, [...this.customTesters, iterableEquality]);
1042
1043 const message = pass
1044 ? () =>
1045 matcherHint(matcherName, undefined, undefined, options) +
1046 '\n\n' +
1047 `Expected: not ${printExpected(expected)}\n` +
1048 (stringify(expected) === stringify(received)
1049 ? ''
1050 : `Received: ${printReceived(received)}`)
1051 : () =>
1052 matcherHint(matcherName, undefined, undefined, options) +
1053 '\n\n' +
1054 printDiffOrStringify(expected, received, EXPECTED_LABEL, RECEIVED_LABEL, false);
1055
1056 return { actual: received, expected, message, name: matcherName, pass };
1057 },
1058
1059 toHaveLength(received: any, expected: number) {
1060 const matcherName = 'toHaveLength';

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…