SettingsTests.js 654 B

123456789101112131415161718192021
  1. const chai = require('chai')
  2. const { expect } = chai
  3. const SandboxedModule = require('sandboxed-module')
  4. describe('Settings', function () {
  5. describe('s3', function () {
  6. it('should use JSONified env var if present', function () {
  7. const s3Settings = {
  8. bucket1: {
  9. auth_key: 'bucket1_key',
  10. auth_secret: 'bucket1_secret',
  11. },
  12. }
  13. process.env.S3_BUCKET_CREDENTIALS = JSON.stringify(s3Settings)
  14. const settings = SandboxedModule.require('@overleaf/settings', {
  15. globals: { console, process },
  16. })
  17. expect(settings.filestore.s3.bucketCreds).to.deep.equal(s3Settings)
  18. })
  19. })
  20. })