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