2025-02-11 17:15:56 -05:00
|
|
|
import { JobRepository } from 'src/repositories/job.repository';
|
|
|
|
import { RepositoryInterface } from 'src/types';
|
2024-04-16 10:44:45 -04:00
|
|
|
import { Mocked, vitest } from 'vitest';
|
2023-01-21 11:11:55 -05:00
|
|
|
|
2025-02-11 17:15:56 -05:00
|
|
|
export const newJobRepositoryMock = (): Mocked<RepositoryInterface<JobRepository>> => {
|
2023-01-21 11:11:55 -05:00
|
|
|
return {
|
2024-10-31 13:42:58 -04:00
|
|
|
setup: vitest.fn(),
|
|
|
|
startWorkers: vitest.fn(),
|
|
|
|
run: vitest.fn(),
|
2024-04-16 10:44:45 -04: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 13:51:34 -06:00
|
|
|
removeJob: vitest.fn(),
|
2023-01-21 11:11:55 -05:00
|
|
|
};
|
|
|
|
};
|