mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Add a global test setup file
Configure chai and SandboxedModule globally instead of in every test file. Also add globals that are required for SandboxedModule to work in Node 12.
This commit is contained in:
@@ -10,11 +10,8 @@
|
||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
const SandboxedModule = require('sandboxed-module')
|
||||
const { assert } = require('chai')
|
||||
const sinon = require('sinon')
|
||||
const chai = require('chai')
|
||||
chai.should()
|
||||
const { expect } = chai
|
||||
const { assert, expect } = require('chai')
|
||||
const modulePath = require('path').join(
|
||||
__dirname,
|
||||
'../../../app/js/HttpController'
|
||||
@@ -30,15 +27,9 @@ describe('HttpController', function () {
|
||||
requires: {
|
||||
'./DocManager': (this.DocManager = {}),
|
||||
'./DocArchiveManager': (this.DocArchiveManager = {}),
|
||||
'logger-sharelatex': (this.logger = {
|
||||
log: sinon.stub(),
|
||||
error: sinon.stub(),
|
||||
fatal: sinon.stub()
|
||||
}),
|
||||
'settings-sharelatex': settings,
|
||||
'./HealthChecker': {}
|
||||
},
|
||||
globals: { process }
|
||||
}
|
||||
})
|
||||
this.res = {
|
||||
send: sinon.stub(),
|
||||
|
||||
Reference in New Issue
Block a user