mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
22 lines
610 B
JavaScript
22 lines
610 B
JavaScript
const chai = require('chai')
|
|
const sinonChai = require('sinon-chai')
|
|
const SandboxedModule = require('sandboxed-module')
|
|
|
|
// Chai configuration
|
|
chai.should()
|
|
chai.use(sinonChai)
|
|
|
|
SandboxedModule.configure({
|
|
requires: {
|
|
// pulls in mongodb (via zod ObjectId helpers), which does not compile in
|
|
// the sandbox (missing TextEncoder)
|
|
'@overleaf/validation-tools': require('@overleaf/validation-tools'),
|
|
},
|
|
globals: { Buffer, JSON, console, process },
|
|
sourceTransformers: {
|
|
removeNodePrefix: function (source) {
|
|
return source.replace(/require\(['"]node:/g, "require('")
|
|
},
|
|
},
|
|
})
|