Abstract testing function

test/msw-gcal
Joe Au-Yeung 2023-08-22 21:47:06 -04:00
parent 61201375c1
commit 9aa600035f
1 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,7 @@
import { expect } from "vitest";
// eslint-disable-next-line
export const expectFunctionToBeCalledNthTimesWithArgs = (fn: Function, n: number, args: any) => {
expect(fn).toHaveBeenCalledTimes(n);
expect(fn).toHaveBeenCalledWith(args);
};