mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 13:45:36 +03:00
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.
|
||||
|
||||
```js
|
||||
```ts
|
||||
// global.d.ts
|
||||
declare namespace PlaywrightTest {
|
||||
interface Matchers<R> {
|
||||
toBeWithinRange(a: number, b: number): R;
|
||||
declare global {
|
||||
namespace PlaywrightTest {
|
||||
interface Matchers<R> {
|
||||
toBeWithinRange(a: number, b: number): R;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user