mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-26 14:42:02 +00:00
4d70bd664f
These changes were previously merged, not deployed, and reverted. This reverts the revert. This reverts commit a6b8c6c658b33b6eee78b8b99e43308f32211ae2, reversing changes made to 93c98921372eed4244d22fce800716cb27eca299.
37 lines
676 B
JavaScript
37 lines
676 B
JavaScript
const chai = require('chai')
|
|
const SandboxedModule = require('sandboxed-module')
|
|
const sinon = require('sinon')
|
|
|
|
// Chai configuration
|
|
chai.should()
|
|
|
|
// Global stubs
|
|
const sandbox = sinon.createSandbox()
|
|
const stubs = {
|
|
logger: {
|
|
debug: sandbox.stub(),
|
|
log: sandbox.stub(),
|
|
warn: sandbox.stub(),
|
|
err: sandbox.stub(),
|
|
error: sandbox.stub()
|
|
}
|
|
}
|
|
|
|
// SandboxedModule configuration
|
|
SandboxedModule.configure({
|
|
requires: {
|
|
'logger-sharelatex': stubs.logger
|
|
},
|
|
globals: { Buffer, JSON, Math, console, process }
|
|
})
|
|
|
|
// Mocha hooks
|
|
exports.mochaHooks = {
|
|
beforeEach() {
|
|
this.logger = stubs.logger
|
|
},
|
|
|
|
afterEach() {
|
|
sandbox.reset()
|
|
}
|
|
}
|