UNPKG

strong-mock

Version:

Type safe mocking library for TypeScript

28 lines (27 loc) 838 B
import type { ExpectationRepository } from '../expectation/repository/expectation-repository'; import type { Mock } from '../mock/mock'; export declare const verifyRepo: (repository: ExpectationRepository) => void; /** * Verify that all expectations on the given mock have been met. * * @throws Will throw if there are remaining expectations that were set * using `when` and that weren't met. * * @throws Will throw if any unexpected calls happened. Normally those * calls throw on their own, but the error might be caught by the code * being tested. * * @example * const fn = mock<() => number>(); * * when(() => fn()).thenReturn(23); * * verify(fn); // throws */ export declare const verify: <T>(mock: Mock<T>) => void; /** * Verify all existing mocks. * * @see verify */ export declare const verifyAll: () => void;