2021-03-12 16:18:36 -05:00
|
|
|
const chai = require('chai')
|
2021-09-07 08:57:47 -04:00
|
|
|
const sinonChai = require('sinon-chai')
|
2022-07-07 08:27:20 -04:00
|
|
|
const chaiAsPromised = require('chai-as-promised')
|
2021-03-12 16:18:36 -05:00
|
|
|
const SandboxedModule = require('sandboxed-module')
|
|
|
|
|
2021-09-07 08:57:47 -04:00
|
|
|
// Setup chai
|
2021-03-12 16:18:36 -05:00
|
|
|
chai.should()
|
2021-09-07 08:57:47 -04:00
|
|
|
chai.use(sinonChai)
|
2022-07-07 08:27:20 -04:00
|
|
|
chai.use(chaiAsPromised)
|
2021-03-12 16:18:36 -05:00
|
|
|
|
|
|
|
// Global SandboxedModule settings
|
|
|
|
SandboxedModule.configure({
|
|
|
|
requires: {
|
2022-03-01 10:09:36 -05:00
|
|
|
'@overleaf/logger': {
|
2021-09-07 08:57:47 -04:00
|
|
|
debug() {},
|
2021-03-12 16:18:36 -05:00
|
|
|
log() {},
|
|
|
|
info() {},
|
|
|
|
warn() {},
|
|
|
|
error() {},
|
2021-07-13 07:04:48 -04:00
|
|
|
err() {},
|
|
|
|
},
|
2021-03-12 16:18:36 -05:00
|
|
|
},
|
2021-10-06 04:11:59 -04:00
|
|
|
globals: { Buffer, console, process, URL },
|
2024-11-08 05:21:56 -05:00
|
|
|
sourceTransformers: {
|
|
|
|
removeNodePrefix: function (source) {
|
|
|
|
return source.replace(/require\(['"]node:/g, "require('")
|
|
|
|
},
|
|
|
|
},
|
2021-03-12 16:18:36 -05:00
|
|
|
})
|