overleaf/services/clsi/test/setup.js

30 lines
655 B
JavaScript
Raw Normal View History

const chai = require('chai')
const sinonChai = require('sinon-chai')
const chaiAsPromised = require('chai-as-promised')
const SandboxedModule = require('sandboxed-module')
// Setup chai
chai.should()
chai.use(sinonChai)
chai.use(chaiAsPromised)
// Global SandboxedModule settings
SandboxedModule.configure({
requires: {
'@overleaf/logger': {
debug() {},
log() {},
info() {},
warn() {},
error() {},
2021-07-13 07:04:48 -04:00
err() {},
},
},
globals: { Buffer, console, process, URL },
sourceTransformers: {
removeNodePrefix: function (source) {
return source.replace(/require\(['"]node:/g, "require('")
},
},
})