fast-check
Version:
Property based testing framework for JavaScript (like QuickCheck)
21 lines (20 loc) • 560 B
TypeScript
import { Arbitrary } from './definition/Arbitrary';
/**
* Generate non-contiguous ranges of values
* by mapping integer values to constant
*
* @param options - Builders to be called to generate the values
*
* @example
* ```
* // generate alphanumeric values (a-z0-9)
* mapToConstant(
* { num: 26, build: v => String.fromCharCode(v + 0x61) },
* { num: 10, build: v => String.fromCharCode(v + 0x30) },
* )
* ```
*/
export declare function mapToConstant<T>(...entries: {
num: number;
build: (idInGroup: number) => T;
}[]): Arbitrary<T>;