2024-03-20 21:42:58 +01:00
|
|
|
import { IJobRepository } from 'src/interfaces/job.repository';
|
2023-01-21 11:11:55 -05:00
|
|
|
|
|
|
|
export const newJobRepositoryMock = (): jest.Mocked<IJobRepository> => {
|
|
|
|
return {
|
2023-06-01 06:32:51 -04:00
|
|
|
addHandler: jest.fn(),
|
2023-10-31 21:19:12 +01:00
|
|
|
addCronJob: jest.fn(),
|
|
|
|
deleteCronJob: jest.fn(),
|
|
|
|
updateCronJob: jest.fn(),
|
2023-06-01 06:32:51 -04:00
|
|
|
setConcurrency: jest.fn(),
|
2023-01-21 23:13:36 -05:00
|
|
|
empty: jest.fn(),
|
2023-03-20 11:55:28 -04:00
|
|
|
pause: jest.fn(),
|
2023-03-28 14:25:22 -04:00
|
|
|
resume: jest.fn(),
|
2023-02-25 09:12:03 -05:00
|
|
|
queue: jest.fn().mockImplementation(() => Promise.resolve()),
|
2024-01-01 15:45:42 -05:00
|
|
|
queueAll: jest.fn().mockImplementation(() => Promise.resolve()),
|
2023-04-01 22:46:07 +02:00
|
|
|
getQueueStatus: jest.fn(),
|
2023-01-21 23:13:36 -05:00
|
|
|
getJobCounts: jest.fn(),
|
2023-12-05 10:07:20 +08:00
|
|
|
clear: jest.fn(),
|
2024-01-18 00:08:48 -05:00
|
|
|
waitForQueueCompletion: jest.fn(),
|
2023-01-21 11:11:55 -05:00
|
|
|
};
|
|
|
|
};
|