strong-mock
Version:
Type safe mocking library for TypeScript
45 lines (44 loc) • 1.21 kB
TypeScript
import type { Expectation } from '../expectation/expectation';
export interface InvocationCount {
/**
* Expect a call to be made at least `min` times and at most `max` times.
*/
between: (min: number, max: number) => void;
/**
* Expect a call to be made exactly `exact` times.
*
* Shortcut for `between(exact, exact)`.
*/
times: (exact: number) => void;
/**
* Expect a call to be made any number of times, including never.
*
* Shortcut for `between(0, Infinity)`.
*/
anyTimes: () => void;
/**
* Expect a call to be made at least `min` times.
*
* Shortcut for `between(min, Infinity)`.
*/
atLeast: (min: number) => void;
/**
* Expect a call to be made at most `max` times.
*
* Shortcut for `between(0, max)`.
*/
atMost: (max: number) => void;
/**
* Expect a call to be made exactly once.
*
* Shortcut for `times(1)`.
*/
once: () => void;
/**
* Expect a call to be made exactly twice.
*
* Shortcut for `times(2)`.
*/
twice: () => void;
}
export declare const createInvocationCount: (expectation: Expectation) => InvocationCount;