refactor(server): metric repo (#8278)

* refactor

* redundant `implements`

* simplify

* remove `enabled`
This commit is contained in:
Mert 2024-03-25 19:15:11 -04:00 committed by GitHub
parent c56c04a82b
commit c45e28ab53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 79 additions and 34 deletions

View file

@ -2,8 +2,29 @@ import { IMetricRepository } from 'src/interfaces/metric.interface';
export const newMetricRepositoryMock = (): jest.Mocked<IMetricRepository> => {
return {
addToCounter: jest.fn(),
updateGauge: jest.fn(),
updateHistogram: jest.fn(),
api: {
addToCounter: jest.fn(),
addToGauge: jest.fn(),
addToHistogram: jest.fn(),
configure: jest.fn(),
},
host: {
addToCounter: jest.fn(),
addToGauge: jest.fn(),
addToHistogram: jest.fn(),
configure: jest.fn(),
},
jobs: {
addToCounter: jest.fn(),
addToGauge: jest.fn(),
addToHistogram: jest.fn(),
configure: jest.fn(),
},
repo: {
addToCounter: jest.fn(),
addToGauge: jest.fn(),
addToHistogram: jest.fn(),
configure: jest.fn(),
},
};
};