mirror of
https://github.com/immich-app/immich.git
synced 2025-01-01 08:31:59 +00:00
20 lines
519 B
TypeScript
20 lines
519 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 {
|
|
api: newMetricGroupMock(),
|
|
host: newMetricGroupMock(),
|
|
jobs: newMetricGroupMock(),
|
|
repo: newMetricGroupMock(),
|
|
};
|
|
};
|