2024-03-21 12:59:49 +01:00
|
|
|
import { IJobRepository } from 'src/interfaces/job.interface';
|
2024-04-16 16:44:45 +02:00
|
|
|
import { Mocked, vitest } from 'vitest';
|
2023-01-21 17:11:55 +01:00
|
|
|
|
2024-04-16 16:44:45 +02:00
|
|
|
export const newJobRepositoryMock = (): Mocked<IJobRepository> => {
|
2023-01-21 17:11:55 +01:00
|
|
|
return {
|
2024-04-16 16:44:45 +02:00
|
|
|
addHandler: vitest.fn(),
|
|
|
|
addCronJob: vitest.fn(),
|
|
|
|
updateCronJob: vitest.fn(),
|
|
|
|
setConcurrency: vitest.fn(),
|
|
|
|
empty: vitest.fn(),
|
|
|
|
pause: vitest.fn(),
|
|
|
|
resume: vitest.fn(),
|
|
|
|
queue: vitest.fn().mockImplementation(() => Promise.resolve()),
|
|
|
|
queueAll: vitest.fn().mockImplementation(() => Promise.resolve()),
|
|
|
|
getQueueStatus: vitest.fn(),
|
|
|
|
getJobCounts: vitest.fn(),
|
|
|
|
clear: vitest.fn(),
|
|
|
|
waitForQueueCompletion: vitest.fn(),
|
2023-01-21 17:11:55 +01:00
|
|
|
};
|
|
|
|
};
|