From 5a14aad368a03f7d7992b18a09dc01746c0fe0f3 Mon Sep 17 00:00:00 2001 From: William Bergeron-Drouin Date: Mon, 31 Jan 2022 12:58:45 -0500 Subject: [PATCH] docs: fix instructions for custom matchers type declarations (#11483) Co-authored-by: Max Schmitt --- docs/src/test-advanced-js.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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; + } } } ```