2024-03-25 04:02:04 +01:00
|
|
|
import { IMetricRepository } from 'src/interfaces/metric.interface';
|
2024-04-16 16:44:45 +02:00
|
|
|
import { Mocked, vitest } from 'vitest';
|
2024-03-25 04:02:04 +01:00
|
|
|
|
2024-04-16 16:44:45 +02:00
|
|
|
export const newMetricRepositoryMock = (): Mocked<IMetricRepository> => {
|
2024-03-25 04:02:04 +01:00
|
|
|
return {
|
2024-03-26 00:15:11 +01:00
|
|
|
api: {
|
2024-04-16 16:44:45 +02:00
|
|
|
addToCounter: vitest.fn(),
|
|
|
|
addToGauge: vitest.fn(),
|
|
|
|
addToHistogram: vitest.fn(),
|
|
|
|
configure: vitest.fn(),
|
2024-03-26 00:15:11 +01:00
|
|
|
},
|
|
|
|
host: {
|
2024-04-16 16:44:45 +02:00
|
|
|
addToCounter: vitest.fn(),
|
|
|
|
addToGauge: vitest.fn(),
|
|
|
|
addToHistogram: vitest.fn(),
|
|
|
|
configure: vitest.fn(),
|
2024-03-26 00:15:11 +01:00
|
|
|
},
|
|
|
|
jobs: {
|
2024-04-16 16:44:45 +02:00
|
|
|
addToCounter: vitest.fn(),
|
|
|
|
addToGauge: vitest.fn(),
|
|
|
|
addToHistogram: vitest.fn(),
|
|
|
|
configure: vitest.fn(),
|
2024-03-26 00:15:11 +01:00
|
|
|
},
|
|
|
|
repo: {
|
2024-04-16 16:44:45 +02:00
|
|
|
addToCounter: vitest.fn(),
|
|
|
|
addToGauge: vitest.fn(),
|
|
|
|
addToHistogram: vitest.fn(),
|
|
|
|
configure: vitest.fn(),
|
2024-03-26 00:15:11 +01:00
|
|
|
},
|
2024-03-25 04:02:04 +01:00
|
|
|
};
|
|
|
|
};
|