Merge branch 'renovate/all-minor-patch' into 'main'
[ProtonMail-WebClient.git] / packages / testing / lib / mockUseApi.ts
blob928533d7e9d526b305536c63f094b3ec43588840
1 import * as useApiModule from '@proton/components/hooks/useApi';
3 export const mockUseApi = (value?: ReturnType<typeof useApiModule.default>) => {
4     const mockedUseApi = jest.spyOn(useApiModule, 'default');
6     mockedUseApi.mockReturnValue(value ?? jest.fn());
8     return mockedUseApi;
9 };