MatcherRequirements: {
    matcherState: MatcherState;
    getErrorWhenAsserted(): MatcherError | Promise<MatcherError>;
    getErrorWhenNegated(): MatcherError | Promise<MatcherError>;
}

The requirements to define the logic of a matcher via implementMatcher.

Type declaration

  • ReadonlymatcherState: MatcherState

    The this: MatcherState opening the parameter list of every matcher.

  • getErrorWhenAsserted:function
    • Evaluates whether the matcher is successful when asserted.

      Returns MatcherError | Promise<MatcherError>

      The error message that must be triggered by the matcher in this flow, or null if everything is fine; returning a Promise will create an asynchronous matcher.

  • getErrorWhenNegated:function
    • Evaluates whether the matcher is successful when negated.

      Returns MatcherError | Promise<MatcherError>

      The error message that must be triggered by the matcher in this flow, or null if everything is fine; returning a Promise will create an asynchronous matcher.