fix settings unit test

This commit is contained in:
Brian Gough 2020-02-28 15:27:29 +00:00
parent e3011b2521
commit ebabe52632

View file

@ -1,5 +1,6 @@
const chai = require('chai') const chai = require('chai')
const { expect } = chai const { expect } = chai
const SandboxedModule = require('sandboxed-module')
describe('Settings', function() { describe('Settings', function() {
describe('s3', function() { describe('s3', function() {
@ -11,8 +12,9 @@ describe('Settings', function() {
} }
} }
process.env.S3_BUCKET_CREDENTIALS = JSON.stringify(s3Settings) process.env.S3_BUCKET_CREDENTIALS = JSON.stringify(s3Settings)
const settings = SandboxedModule.require('settings-sharelatex', {
const settings = require('settings-sharelatex') globals: { console }
})
expect(settings.filestore.s3BucketCreds).to.deep.equal(s3Settings) expect(settings.filestore.s3BucketCreds).to.deep.equal(s3Settings)
}) })
}) })