From 407f12f4a5c4481c7ae0b7309fc4c9c05a72c32d Mon Sep 17 00:00:00 2001 From: Mordechai Dror Date: Mon, 15 Jul 2024 11:49:57 +0300 Subject: [PATCH] docs: improve extending matchers docs (#6121) --- docs/guide/extending-matchers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guide/extending-matchers.md b/docs/guide/extending-matchers.md index 1c650cc856a7..e5a6f7015234 100644 --- a/docs/guide/extending-matchers.md +++ b/docs/guide/extending-matchers.md @@ -26,7 +26,7 @@ expect.extend({ If you are using TypeScript, you can extend default `Assertion` interface in an ambient declaration file (e.g: `vitest.d.ts`) with the code below: ```ts -import type { Assertion, AsymmetricMatchersContaining } from 'vitest' +import 'vitest' interface CustomMatchers { toBeFoo: () => R @@ -45,7 +45,7 @@ Don't forget to include the ambient declaration file in your `tsconfig.json`. The return value of a matcher should be compatible with the following interface: ```ts -interface MatcherResult { +interface ExpectationResult { pass: boolean message: () => string // If you pass these, they will automatically appear inside a diff when