oneuptime/Common/Tests/Spy.ts
Simon Larsen 6e0e643337
refactor: Update import statements for jest in test files
This commit updates the import statements for jest in multiple test files. The previous import statements used "globals" as the module name, which is incorrect. The correct module name is "jest". This change ensures that the jest module is imported correctly, improving the accuracy and reliability of the test setup.
2024-06-14 17:01:06 +01:00

12 lines
278 B
TypeScript

type GetJestSpyOnFunction = (
obj: any,
method: string,
) => jest.SpyInstance<any, any>;
export const getJestSpyOn: GetJestSpyOnFunction = (
obj: any,
method: string,
): jest.SpyInstance<any, any> => {
return jest.spyOn(obj, method) as jest.SpyInstance<any, any>;
};