Skip to content

Commit

Permalink
docs: improve extending matchers docs (#6121)
Browse files Browse the repository at this point in the history
  • Loading branch information
vorant94 committed Jul 15, 2024
1 parent d7b0387 commit 407f12f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/guide/extending-matchers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<R = unknown> {
toBeFoo: () => R
Expand All @@ -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
Expand Down

0 comments on commit 407f12f

Please sign in to comment.