mirror of
https://github.com/immich-app/immich.git
synced 2024-11-28 09:33:27 +02:00
21 lines
519 B
TypeScript
21 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(),
|
||
|
};
|
||
|
};
|