mirror of
https://github.com/immich-app/immich.git
synced 2024-11-24 08:52:28 +02:00
e6a666f1d3
refactor: telemetry
22 lines
543 B
TypeScript
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(),
|
|
};
|
|
};
|