2024-03-21 11:59:49 +00:00
|
|
|
import { IJobRepository } from 'src/interfaces/job.interface';
|
2024-04-16 14:44:45 +00:00
|
|
|
import { Mocked, vitest } from 'vitest';
|
2023-01-21 16:11:55 +00:00
|
|
|
|
2024-04-16 14:44:45 +00:00
|
|
|
export const newJobRepositoryMock = (): Mocked<IJobRepository> => {
|
2023-01-21 16:11:55 +00:00
|
|
|
return {
|
2024-10-31 17:42:58 +00:00
|
|
|
setup: vitest.fn(),
|
|
|
|
startWorkers: vitest.fn(),
|
|
|
|
run: vitest.fn(),
|
2024-04-16 14:44:45 +00:00
|
|
|
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(),
|
2024-10-18 19:51:34 +00:00
|
|
|
removeJob: vitest.fn(),
|
2023-01-21 16:11:55 +00:00
|
|
|
};
|
|
|
|
};
|