docs: fix instructions for custom matchers type declarations (#11483)
Co-authored-by: Max Schmitt <max@schmitt.mx>
This commit is contained in:
parent
a7e73cc389
commit
5a14aad368
|
|
@ -554,11 +554,13 @@ test('numeric ranges', () => {
|
||||||
|
|
||||||
For TypeScript, also add the following to `global.d.ts`. You don't need it for JavaScript.
|
For TypeScript, also add the following to `global.d.ts`. You don't need it for JavaScript.
|
||||||
|
|
||||||
```js
|
```ts
|
||||||
// global.d.ts
|
// global.d.ts
|
||||||
declare namespace PlaywrightTest {
|
declare global {
|
||||||
interface Matchers<R> {
|
namespace PlaywrightTest {
|
||||||
toBeWithinRange(a: number, b: number): R;
|
interface Matchers<R> {
|
||||||
|
toBeWithinRange(a: number, b: number): R;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue