1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-04 02:46:47 +01:00
immich/server/test/repositories/telemetry.repository.mock.ts

22 lines
543 B
TypeScript
Raw Normal View History

import { ITelemetryRepository } from 'src/interfaces/telemetry.interface';
import { Mocked, vitest } from 'vitest';
const newMetricGroupMock = () => {
return {
addToCounter: vitest.fn(),
addToGauge: vitest.fn(),
addToHistogram: vitest.fn(),
configure: vitest.fn(),
};
};
export const newTelemetryRepositoryMock = (): Mocked<ITelemetryRepository> => {
return {
setup: vitest.fn(),
api: newMetricGroupMock(),
host: newMetricGroupMock(),
jobs: newMetricGroupMock(),
repo: newMetricGroupMock(),
};
};