cooky-cutter
Version:
Object factories for testing in TypeScript
16 lines (15 loc) • 557 B
TypeScript
declare const MAX_RANDOM_VALUE = 2147483647;
declare const MIN_RANDOM_VALUE = 1;
/**
* Assign a random number to the attribute. This is useful for attributes like
* seeds or ids (to avoid tests passing as a result of ordering)
*/
declare const random: () => number;
/**
* Increment the attribute each time the factory is invoked. This is useful
* for counts (`random` may be a better option for `ids`).
*
* @param invocation
*/
declare const sequence: (invocation: number) => number;
export { random, sequence, MAX_RANDOM_VALUE, MIN_RANDOM_VALUE };