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:
parent
a106428114
commit
f7b0490500
|
|
@ -25,9 +25,6 @@ import type { Locator } from 'playwright-core';
|
||||||
const EXPECTED_LABEL = 'Expected';
|
const EXPECTED_LABEL = 'Expected';
|
||||||
const RECEIVED_LABEL = 'Received';
|
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>(
|
export async function toEqual<T>(
|
||||||
this: ExpectMatcherContext,
|
this: ExpectMatcherContext,
|
||||||
matcherName: string,
|
matcherName: string,
|
||||||
|
|
@ -61,7 +58,7 @@ export async function toEqual<T>(
|
||||||
received,
|
received,
|
||||||
EXPECTED_LABEL,
|
EXPECTED_LABEL,
|
||||||
RECEIVED_LABEL,
|
RECEIVED_LABEL,
|
||||||
isExpand(this.expand),
|
false,
|
||||||
) + callLogText(log);
|
) + callLogText(log);
|
||||||
|
|
||||||
// Passing the actual and expected objects so that a custom reporter
|
// Passing the actual and expected objects so that a custom reporter
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ export async function toMatchText(
|
||||||
const labelExpected = `Expected ${typeof expected === 'string' ? stringSubstring : 'pattern'}`;
|
const labelExpected = `Expected ${typeof expected === 'string' ? stringSubstring : 'pattern'}`;
|
||||||
if (notFound)
|
if (notFound)
|
||||||
return messagePrefix + `${labelExpected}: ${this.utils.printExpected(expected)}\nReceived: ${received}` + callLogText(log);
|
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);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue