Add global test setup

Configure chai and SandboxedModule in a central place and add
SandboxedModule globals that are required in Node 12.
This commit is contained in:
Eric Mc Sween
2021-03-17 16:34:06 -04:00
parent c3a4cf692b
commit 821972b791
4 changed files with 29 additions and 17 deletions
+21
View File
@@ -0,0 +1,21 @@
const chai = require('chai')
const SandboxedModule = require('sandboxed-module')
// Chai configuration
chai.should()
// SandboxedModule configuration
SandboxedModule.configure({
requires: {
'logger-sharelatex': {
debug() {},
log() {},
info() {},
warn() {},
err() {},
error() {},
fatal() {}
}
},
globals: { Buffer, JSON, console, process }
})