Options
All
  • Public
  • Public/Protected
  • All
Menu

An 'elementary' expectation: it resolves a provided (inputData: unknown) => boolean function. It represents the leafs of the expectation trees of contract.

❕ The function resolve is generally used to construct Of expectation.

Type parameters

  • T

    The type of FulfilledExpectation.value, i.e. the type of the expectation return's value (normalized value) when the expectation is fulfilled

Hierarchy

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Of<T>(description: string, when: (inputData: unknown) => boolean, normalizeTo?: (leafData: any) => T): Of<T>
  • Type parameters

    • T

    Parameters

    • description: string

      description of the expectation

    • when: (inputData: unknown) => boolean

      defines the condition of fulfillment

        • (inputData: unknown): boolean
        • Parameters

          • inputData: unknown

          Returns boolean

    • normalizeTo: (leafData: any) => T = ...

      defines how to normalize the data

        • (leafData: any): T
        • Parameters

          • leafData: any

          Returns T

    Returns Of<T>

Properties

Readonly description

description: string

description of the expectation

Readonly normalizeTo

normalizeTo: (leafData: any) => T = ...

Type declaration

    • (leafData: any): T
    • Parameters

      • leafData: any

      Returns T

Readonly when

when: (inputData: unknown) => boolean

Type declaration

    • (inputData: unknown): boolean
    • Parameters

      • inputData: unknown

      Returns boolean

Methods

resolve

Generated using TypeDoc