mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 10:10:08 +02:00
[real-time] convert real time to esm GitOrigin-RevId: 7cc530cc977549d3274be42585735e1fd72cad5f
35 lines
707 B
JavaScript
35 lines
707 B
JavaScript
import { afterEach, beforeEach, chai, vi } from 'vitest'
|
|
import sinon from 'sinon'
|
|
import chaiAsPromised from 'chai-as-promised'
|
|
import sinonChai from 'sinon-chai'
|
|
|
|
// Chai configuration
|
|
chai.should()
|
|
chai.use(chaiAsPromised)
|
|
chai.use(sinonChai)
|
|
|
|
// 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(),
|
|
},
|
|
}
|
|
|
|
// Mocha hooks
|
|
beforeEach(ctx => {
|
|
ctx.logger = stubs.logger
|
|
vi.doMock('@overleaf/logger', () => ({ default: ctx.logger }))
|
|
})
|
|
|
|
afterEach(() => {
|
|
sandbox.reset()
|
|
vi.restoreAllMocks()
|
|
vi.resetModules()
|
|
})
|