mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
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:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user