1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-01 08:31:59 +00:00
immich/server/test/repositories/telemetry.repository.mock.ts
Jason Rasmussen e6a666f1d3
refactor(server): telemetry (#13588)
refactor: telemetry
2024-10-21 23:52:30 +00:00

21 lines
543 B
TypeScript

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(),
};
};