API Reference | fast-check | Property based testing framework
    Preparing search index...

    Interface SparseArrayConstraints

    Constraints to be applied on sparseArray

    Since 2.13.0

    interface SparseArrayConstraints {
        depthIdentifier?: string | DepthIdentifier;
        maxLength?: number;
        maxNumElements?: number;
        minNumElements?: number;
        noTrailingHole?: boolean;
        size?: SizeForArbitrary;
    }
    Index

    Properties

    depthIdentifier?: string | DepthIdentifier

    When receiving a depth identifier, the arbitrary will impact the depth attached to it to avoid going too deep if it already generated lots of items.

    In other words, if the number of generated values within the collection is large then the generated items will tend to be less deep to avoid creating structures a lot larger than expected.

    For the moment, the depth is not taken into account to compute the number of items to define for a precise generate call of the array. Just applied onto eligible items.

    Since 2.25.0

    maxLength?: number

    Upper bound of the generated array size (maximal size: 4294967295)

    0x7fffffff — defaulting seen as "max non specified" when defaultSizeToMaxWhenMaxSpecified=true

    Since 2.13.0

    maxNumElements?: number

    Upper bound of the number of non-hole elements

    0x7fffffff — defaulting seen as "max non specified" when defaultSizeToMaxWhenMaxSpecified=true

    Since 2.13.0

    minNumElements?: number

    Lower bound of the number of non-hole elements

    0
    

    Since 2.13.0

    noTrailingHole?: boolean

    When enabled, all generated arrays will either be the empty array or end by a non-hole

    false
    

    Since 2.13.0

    Define how large the generated values should be (at max)

    Since 2.22.0