Builder for combinatorial test case parameters.

CaseParamsBuilder is immutable. Each method call returns a new, immutable object, modifying the list of cases according to the method called.

This means, for example, that the unit passed into TestBuilder.params() can be reused.

Type Parameters

  • CaseP extends {}

Hierarchy

Implements

Constructors

Methods

  • Expands each item in this to multiple items with { [name]: value } for each value.

    In other words, takes the cartesian product of [ the items in this ] and [ {[name]: value} for each value in values ]

    Type Parameters

    • NewPKey extends string

    • NewPValue

    Parameters

    • key: NewPKey
    • values: Iterable<NewPValue>

    Returns CaseParamsBuilder<Merged<CaseP, {
        [name in string]: NewPValue
    }>>

  • Expands each item in this to multiple items, one for each item in newParams.

    In other words, takes the cartesian product of [ the items in this ] and newParams.

    Note: When only a single key is being added, use the simpler combine for readability.

                        this = [ {a:1}, {b:2} ]
                   newParams = [ {x:1}, {y:2} ]
    this.combineP(newParams) = [ {a:1,x:1}, {a:1,y:2}, {b:2,x:1}, {b:2,y:2} ]
    

    Type Parameters

    • NewP extends {}

    Parameters

    • newParams: Iterable<NewP>

    Returns CaseParamsBuilder<Merged<CaseP, NewP>>

  • Expands each item in this into zero or more items. Each item has its parameters expanded with one new key, key, and the values returned by expander.

    Type Parameters

    • NewPKey extends string

    • NewPValue

    Parameters

    • key: NewPKey
    • expander: ((_) => Iterable<NewPValue>)
        • (_): Iterable<NewPValue>
        • Parameters

          • _: CaseP

          Returns Iterable<NewPValue>

    Returns CaseParamsBuilder<Merged<CaseP, {
        [name in string]: NewPValue
    }>>

  • Expands each item in this into zero or more items. Each item has its parameters expanded with those returned by the expander.

    Note: When only a single key is being added, use the simpler expand for readability.

                  this = [     a       ,      b     ,       c       ]
    this.map(expander) = [   f(a)           f(b)          f(c)      ]
                       = [[a1, a2, a3] ,    [ b1 ]  ,       []      ]
     merge and flatten = [ merge(a, a1), merge(a, a2), merge(a, a3), merge(b, b1) ]
    

    Type Parameters

    • NewP extends {}

    Parameters

    • expander: ((_) => Iterable<NewP>)
        • (_): Iterable<NewP>
        • Parameters

          • _: CaseP

          Returns Iterable<NewP>

    Returns CaseParamsBuilder<Merged<CaseP, NewP>>

Generated using TypeDoc