Global test setup

Configure chai and SandboxedModule globally with options used in many
tests.

That required upgrading mocha and SandboxedModule.
This commit is contained in:
Eric Mc Sween
2021-03-16 16:48:45 -04:00
parent 23738540ed
commit dc5bfea181
38 changed files with 578 additions and 228 deletions
@@ -11,8 +11,6 @@
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const sinon = require('sinon')
const chai = require('chai')
const should = chai.should()
const modulePath = '../../../../app/js/ProjectManager.js'
const SandboxedModule = require('sandboxed-module')
const Errors = require('../../../../app/js/Errors.js')
@@ -25,10 +23,6 @@ describe('ProjectManager - getProjectDocsAndFlushIfOld', function () {
'./RedisManager': (this.RedisManager = {}),
'./ProjectHistoryRedisManager': (this.ProjectHistoryRedisManager = {}),
'./DocumentManager': (this.DocumentManager = {}),
'logger-sharelatex': (this.logger = {
log: sinon.stub(),
error: sinon.stub()
}),
'./HistoryManager': (this.HistoryManager = {}),
'./Metrics': (this.Metrics = {
Timer: (Timer = (function () {