Go to repository

Interface FinishedExpectation

This interface represents an expectation after a matcher has been executed and the result can be accessed.

interface FinishedExpectation {
    andDo(action: (() => void)): void;
    andDoOr(actionIfTrue: (() => void), actionIfFalse: (() => void)): void;
    getResult(): boolean;
    orDo(action: (() => void)): void;
    orThrow(error: Error): void;
    orYield<T>(value: T): T;
}

Implemented by

Methods

If the result of the expectation is true, run the given function.

Parameters

  • action: (() => void)
      • (): void
      • Returns void

Returns void

If the result of the expectation is true, run the first of the functions, if false, run the second one.

Parameters

  • actionIfTrue: (() => void)
      • (): void
      • Returns void

  • actionIfFalse: (() => void)
      • (): void
      • Returns void

Returns void

Return's the result of the expectancy as a boolean.

Returns boolean

true if the value satisfied the expectation, falseotherwise.

If the result of the expectation is false, run the given function.

Parameters

  • action: (() => void)
      • (): void
      • Returns void

Returns void

If the result of the expectation is false, throw the given error.

Parameters

Returns void

If the result of the expectation is false, return the given value.

Type Parameters

  • T

Parameters

  • value: T

Returns T