mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
28 lines
570 B
JavaScript
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()
|
|
})
|