MatcherInvoker: (assertion: Assertion<unknown>) => void | Promise<void>

Function having the purpose of invoking a matcher.

The matcher can be either synchronous or asynchronous - both cases will be transparently handled.

Type declaration

    • (assertion: Assertion<unknown>): void | Promise<void>
    • Parameters

      • assertion: Assertion<unknown>

        The result of expect(...) or expect(...).not - so you'll need to call a .toBe|Have|...() matcher on it:

        e => e.toBe(90)
        

      Returns void | Promise<void>

      • void - in the case of a synchronous matcher.

      • Promise<void> in the case of an asynchronous matcher.