diff --git a/exercises/03.assertions/01.solution.custom-matchers/README.mdx b/exercises/03.assertions/01.solution.custom-matchers/README.mdx index 04bde47..2562262 100644 --- a/exercises/03.assertions/01.solution.custom-matchers/README.mdx +++ b/exercises/03.assertions/01.solution.custom-matchers/README.mdx @@ -34,15 +34,11 @@ interface CustomMatchers { } declare module 'vitest' { - interface Assertion extends CustomMatchers {} - interface MatchersDeclaration extends CustomMatchers {} + interface Matchers extends CustomMatchers {} } ``` -There are two interfaces from `vitest` that I extend using module augmentgation: - -- `Assertion`, which controls the matchers returned by calling `expect()`; -- `MatchersDeclaration`, which annotates the matcher declarations passed to `expect.extend()`. +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. This is enough for the `.toMatchSchema()` custom matcher to be recognized by TypeScript: