mirror of
https://github.com/microsoft/playwright.git
synced 2024-11-28 01:15:10 +03:00
This PR cherry-picks the following commits:
- c9eac69f2b
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
6155a50190
commit
20427b9b92
@ -418,7 +418,7 @@ expect(value).toMatches(/Is \d+ enough/);
|
||||
|
||||
### param: GenericAssertions.toMatch.expected
|
||||
* since: v1.9
|
||||
- `expected` <[RegExp]>
|
||||
- `expected` <[RegExp]|[string]>
|
||||
|
||||
Regular expression to match against.
|
||||
|
||||
|
2
packages/playwright-test/types/test.d.ts
vendored
2
packages/playwright-test/types/test.d.ts
vendored
@ -4095,7 +4095,7 @@ interface GenericAssertions<R> {
|
||||
*
|
||||
* @param expected Regular expression to match against.
|
||||
*/
|
||||
toMatch(expected: RegExp): R;
|
||||
toMatch(expected: RegExp | string): R;
|
||||
/**
|
||||
* Compares contents of the value with contents of `expected`, performing "deep equality" check. Allows extra
|
||||
* properties to be present in the value, unlike
|
||||
|
@ -157,6 +157,7 @@ test('should work with generic matchers', async ({ runTSC }) => {
|
||||
expect({}).toEqual({});
|
||||
expect([1, 2]).toHaveLength(2);
|
||||
expect('abc').toMatch(/a.?c/);
|
||||
expect('abc').toMatch('abc');
|
||||
expect({ a: 1, b: 2 }).toMatchObject({ a: 1 });
|
||||
expect({}).toStrictEqual({});
|
||||
expect(() => { throw new Error('Something bad'); }).toThrow('something');
|
||||
|
2
utils/generate_types/overrides-test.d.ts
vendored
2
utils/generate_types/overrides-test.d.ts
vendored
@ -297,7 +297,7 @@ interface GenericAssertions<R> {
|
||||
toEqual(expected: unknown): R;
|
||||
toHaveLength(expected: number): R;
|
||||
toHaveProperty(keyPath: string | Array<string>, value?: unknown): R;
|
||||
toMatch(expected: RegExp): R;
|
||||
toMatch(expected: RegExp | string): R;
|
||||
toMatchObject(expected: Record<string, unknown> | Array<unknown>): R;
|
||||
toStrictEqual(expected: unknown): R;
|
||||
toThrow(error?: unknown): R;
|
||||
|
Loading…
Reference in New Issue
Block a user