Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OptionalsOf<T>

Expectation used to describe optionals values - always fulfilled.

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 OptionalsOf<T>(description: any, expectations: IExpectation<T>[], normalizeTo?: (accData: any) => T): OptionalsOf<T>
  • Type parameters

    • T

    Parameters

    • description: any

      description of the expectation

    • expectations: IExpectation<T>[]

      list of children expectations

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

      defines how to normalize the data from the list of children's normalized data

        • (accData: any): T
        • Parameters

          • accData: any

          Returns T

    Returns OptionalsOf<T>

Properties

Readonly description

description: string

description of the expectation

Readonly expectations

expectations: IExpectation<T>[]

Readonly normalizeTo

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

Type declaration

    • (accData: any): T
    • Parameters

      • accData: any

      Returns T

Readonly when

when: ((inputData: any) => boolean) | BaseExpectation<T>

Methods

resolve

Generated using TypeDoc