BooleanMatcherRequirements: {
    assertionCondition: boolean | Promise<boolean>;
    errorWhenAssertionFails: ValueOrRetriever<string>;
    errorWhenNegationFails: ValueOrRetriever<string>;
    matcherState: MatcherState;
}

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

Type declaration

  • ReadonlyassertionCondition: boolean | Promise<boolean>

    The boolean expression that must be true for the matcher to pass when asserted - i.e., when used directly after .expect(...); returning a Promise will create an asynchronous matcher.

  • ReadonlyerrorWhenAssertionFails: ValueOrRetriever<string>

    Error message to be displayed when the matcher is asserted but assertionCondition is false; it can be either a constant or a function returning the value.

  • ReadonlyerrorWhenNegationFails: ValueOrRetriever<string>

    Error message to be displayed when the matcher is negated but assertionCondition is true; it can be either a constant or a function returning the value.

  • ReadonlymatcherState: MatcherState

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