10 lines
215 B
TypeScript
10 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)
|
||
|
}
|