Files
overleaf-cep/services/notifications/test/setup.js
Andrew Rumble 0a845b3f06 Switch to using vitest for tests
GitOrigin-RevId: 0e448010848011883f8843b6d3280e767cea932e
2025-09-12 08:07:25 +00:00

28 lines
570 B
JavaScript

import { afterEach, chai, vi } from 'vitest'
import mongodb from 'mongodb-legacy'
import chaiAsPromised from 'chai-as-promised'
// Chai configuration
chai.should()
chai.use(chaiAsPromised)
// ensure every ObjectId has the id string as a property for correct comparisons
mongodb.ObjectId.cacheHexString = true
vi.mock('@overleaf/logger', () => ({
default: {
debug: vi.fn(),
log: vi.fn(),
info: vi.fn(),
warn: vi.fn(),
err: vi.fn(),
error: vi.fn(),
fatal: vi.fn(),
},
}))
afterEach(() => {
vi.restoreAllMocks()
vi.resetModules()
})