Skip to content

Commit cc4181c

Browse files
committed
03/01: polish the Matchers explanation
1 parent 257fe15 commit cc4181c

File tree

1 file changed

+1
-3
lines changed
  • exercises/03.assertions/01.solution.custom-matchers

1 file changed

+1
-3
lines changed

exercises/03.assertions/01.solution.custom-matchers/README.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ declare module 'vitest' {
3838
}
3939
```
4040

41-
This is the interface from `vitest` that I extend using module augmentation:
42-
43-
- `Matchers<T>`, which controls the matchers returned by calling `expect()` and annotates the matcher declarations passed to `expect.extend()`.
41+
Here, I'm augmenting the `Matchers` type from `vitest` with my custom `CustomMatchers` type. By doing so, I'm extending the type definitions for the `expect()` function as well as the argument type of `expect.extend()` for later.
4442

4543
This is enough for the `.toMatchSchema()` custom matcher to be recognized by TypeScript:
4644

0 commit comments

Comments
 (0)