9 lines
215 B
TypeScript
9 lines
215 B
TypeScript
export function expectFunctionWasCalledTimesWith(
|
|
jestFunction: any,
|
|
times: number,
|
|
argument: any
|
|
) {
|
|
expect(
|
|
jestFunction.mock.calls.filter((call: any) => call[0] === argument).length
|
|
).toBe(times)
|
|
}
|