diff --git a/packages/playwright/src/matchers/toEqual.ts b/packages/playwright/src/matchers/toEqual.ts index c7b99815f9..9dbf30ec5b 100644 --- a/packages/playwright/src/matchers/toEqual.ts +++ b/packages/playwright/src/matchers/toEqual.ts @@ -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( this: ExpectMatcherContext, matcherName: string, @@ -61,7 +58,7 @@ export async function toEqual( received, EXPECTED_LABEL, RECEIVED_LABEL, - isExpand(this.expand), + false, ) + callLogText(log); // Passing the actual and expected objects so that a custom reporter diff --git a/packages/playwright/src/matchers/toMatchText.ts b/packages/playwright/src/matchers/toMatchText.ts index 64759f01b8..1d66ab8d68 100644 --- a/packages/playwright/src/matchers/toMatchText.ts +++ b/packages/playwright/src/matchers/toMatchText.ts @@ -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); } };