Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs: fix instructions for custom matchers type declarations (#11483)

William Bergeron-Drouin5a14aad368a0
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<R> {
- toBeWithinRange(a: number, b: number): R;
+declare global {
+ namespace PlaywrightTest {
+ interface Matchers<R> {
+ toBeWithinRange(a: number, b: number): R;
+ }
}
}
```