1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-24 08:52:28 +02: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

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