Add global test setup

Configure chai and SandboxedModule in a central place. Configure
SandboxedModule globals that are required in Node 12.
This commit is contained in:
Eric Mc Sween
2021-03-23 15:08:32 -04:00
parent ccb8a022a9
commit a793ecd41b
24 changed files with 47 additions and 102 deletions
@@ -10,9 +10,7 @@
* 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 { expect } = chai
const { expect } = require('chai')
const modulePath = '../../../../app/js/HttpController.js'
const SandboxedModule = require('sandboxed-module')
@@ -21,7 +19,6 @@ describe('HttpController', function () {
this.HttpController = SandboxedModule.require(modulePath, {
singleOnly: true,
requires: {
'logger-sharelatex': { log: sinon.stub() },
'./UpdatesManager': (this.UpdatesManager = {}),
'./DiffManager': (this.DiffManager = {}),
'./RestoreManager': (this.RestoreManager = {}),