diff --git a/docs/src/test-advanced-js.md b/docs/src/test-advanced-js.md index 51ed0649d0..13244146a4 100644 --- a/docs/src/test-advanced-js.md +++ b/docs/src/test-advanced-js.md @@ -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 { - toBeWithinRange(a: number, b: number): R; +declare global { + namespace PlaywrightTest { + interface Matchers { + toBeWithinRange(a: number, b: number): R; + } } } ```