Merge pull request #32766 from overleaf/bg-add-missing-unit-test-mocks

add missing mocks for @overleaf/metrics in unit tests

GitOrigin-RevId: 0903c3e26f88f92ef816a64f14ad053f159b31ed
This commit is contained in:
Brian Gough
2026-04-14 08:04:46 +00:00
committed by Copybot
parent 7bd02a6da4
commit 3f75f35a8e
9 changed files with 62 additions and 5 deletions
+7
View File
@@ -39,6 +39,13 @@ vi.mock('@overleaf/logger', async () => {
}
})
// Mock metrics in unit tests, can be overridden
vi.mock('@overleaf/metrics', () => {
return {
default: { prom: { Counter: vi.fn(), Histogram: vi.fn() } },
}
})
beforeEach(ctx => {
// This function is a utility to duplicate the behaviour of passing `done` in place of `next` in an express route handler.
ctx.rejectOnError = reject => {