chore: remove references to jest expand (#30988)

Since https://github.com/microsoft/playwright/pull/7722 we always set
expand to false
[here](a106428114/packages/playwright/src/matchers/expect.ts (L176))
and don't expose any means to change that (in jest it's
expect.setState).
This commit is contained in:
Yury Semikhatsky 2024-05-23 13:44:15 -07:00 committed by GitHub
parent a106428114
commit f7b0490500
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 5 deletions

View File

@ -25,9 +25,6 @@ import type { Locator } from 'playwright-core';
const EXPECTED_LABEL = 'Expected';
const RECEIVED_LABEL = 'Received';
// The optional property of matcher context is true if undefined.
const isExpand = (expand?: boolean): boolean => expand !== false;
export async function toEqual<T>(
this: ExpectMatcherContext,
matcherName: string,
@ -61,7 +58,7 @@ export async function toEqual<T>(
received,
EXPECTED_LABEL,
RECEIVED_LABEL,
isExpand(this.expand),
false,
) + callLogText(log);
// Passing the actual and expected objects so that a custom reporter

View File

@ -83,7 +83,7 @@ export async function toMatchText(
const labelExpected = `Expected ${typeof expected === 'string' ? stringSubstring : 'pattern'}`;
if (notFound)
return messagePrefix + `${labelExpected}: ${this.utils.printExpected(expected)}\nReceived: ${received}` + callLogText(log);
return messagePrefix + this.utils.printDiffOrStringify(expected, receivedString, labelExpected, 'Received string', this.expand !== false) + callLogText(log);
return messagePrefix + this.utils.printDiffOrStringify(expected, receivedString, labelExpected, 'Received string', false) + callLogText(log);
}
};