• Gather useful statistics concerning generated values

    Print the result in console.log or params.logger (if defined)

    Type Parameters

    • Ts

    Parameters

    • generator: IRawProperty<Ts, boolean> | Arbitrary<Ts>

      IProperty or Arbitrary to extract the values from

    • classify: ((v) => string | string[])

      Classifier function that can classify the generated value in zero, one or more categories (with free labels)

        • (v): string | string[]
        • Parameters

          Returns string | string[]

    • Optional params: number | Parameters<Ts>

      Integer representing the number of values to generate or Parameters as in assert

    Returns void

    Example

    fc.statistics(
    fc.nat(999),
    v => v < 100 ? 'Less than 100' : 'More or equal to 100',
    {numRuns: 1000, logger: console.log});
    // Classify 1000 values generated by fc.nat(999) into two categories:
    // - Less than 100
    // - More or equal to 100
    // The output will be sent line by line to the logger

    Remarks

    Since 0.0.6