mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Merge pull request #29948 from overleaf/ar/docstore-conversion-to-esm
[docstore] conversion to esm GitOrigin-RevId: 9d255047bd7ae25f2b0b38f3a721741e8a0b7ad8
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import { afterEach, beforeEach, chai, vi } from 'vitest'
|
||||
import sinon from 'sinon'
|
||||
import sinonChai from 'sinon-chai'
|
||||
import chaiAsPromised from 'chai-as-promised'
|
||||
import mongodb from 'mongodb-legacy'
|
||||
|
||||
// ensure every ObjectId has the id string as a property for correct comparisons
|
||||
mongodb.ObjectId.cacheHexString = true
|
||||
|
||||
process.env.BACKEND = 'gcs'
|
||||
|
||||
// Chai configuration
|
||||
chai.should()
|
||||
chai.use(sinonChai)
|
||||
chai.use(chaiAsPromised)
|
||||
|
||||
// Global stubs
|
||||
const sandbox = sinon.createSandbox()
|
||||
const stubs = {
|
||||
logger: {
|
||||
debug: sandbox.stub(),
|
||||
log: sandbox.stub(),
|
||||
info: sandbox.stub(),
|
||||
warn: sandbox.stub(),
|
||||
err: sandbox.stub(),
|
||||
error: sandbox.stub(),
|
||||
fatal: sandbox.stub(),
|
||||
},
|
||||
}
|
||||
|
||||
beforeEach(ctx => {
|
||||
ctx.logger = stubs.logger
|
||||
vi.doMock('@overleaf/logger', () => ({ default: ctx.logger }))
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks()
|
||||
vi.resetModules()
|
||||
sandbox.reset()
|
||||
})
|
||||
Reference in New Issue
Block a user