Skip to main content

Function: logStatistics()

logStatistics(stats, logger?): void

Defined in: packages/fast-check/src/check/runner/Sampler.ts:254

Print statistics using the default format. Percentages are calculated from category counts and the number of sampled values.

Parameters​

ParameterTypeDefault valueDescription
statsStatisticsResultundefinedCategory counts and number of sampled values returned by statistics
logger?(line) => voidconsole.logFunction receiving each line, console.log by default

Returns​

void

Example​

fc.logStatistics(
await fc.statistics(
fc.nat(),
v => v < 100 ? 'Small' : 'Large'
)
);

Remarks​

Since 5.0.0