2019-12-16 06:20:25 -05:00
|
|
|
/* eslint-disable
|
|
|
|
camelcase,
|
|
|
|
no-unused-vars,
|
|
|
|
*/
|
|
|
|
// TODO: This file was created by bulk-decaffeinate.
|
|
|
|
// Fix any style issues and re-enable lint.
|
2019-12-16 06:20:22 -05:00
|
|
|
/*
|
|
|
|
* decaffeinate suggestions:
|
|
|
|
* DS102: Remove unnecessary code created because of implicit returns
|
|
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
|
|
*/
|
2019-12-16 06:20:29 -05:00
|
|
|
const { assert } = require('chai')
|
|
|
|
const sinon = require('sinon')
|
|
|
|
const chai = require('chai')
|
|
|
|
const should = chai.should()
|
|
|
|
const { expect } = chai
|
|
|
|
const modulePath = '../../../app/js/BucketController.js'
|
2018-07-06 06:05:40 -04:00
|
|
|
|
2019-12-16 06:20:29 -05:00
|
|
|
describe('Settings', () =>
|
|
|
|
describe('s3', () =>
|
|
|
|
it('should use JSONified env var if present', function(done) {
|
|
|
|
const s3_settings = {
|
2019-12-16 06:20:22 -05:00
|
|
|
bucket1: {
|
2019-12-16 06:20:29 -05:00
|
|
|
auth_key: 'bucket1_key',
|
|
|
|
auth_secret: 'bucket1_secret'
|
2019-12-16 06:20:22 -05:00
|
|
|
}
|
2019-12-16 06:20:29 -05:00
|
|
|
}
|
|
|
|
process.env.S3_BUCKET_CREDENTIALS = JSON.stringify(s3_settings)
|
2018-07-06 06:05:40 -04:00
|
|
|
|
2019-12-16 06:20:29 -05:00
|
|
|
const settings = require('settings-sharelatex')
|
|
|
|
expect(settings.filestore.s3BucketCreds).to.deep.equal(s3_settings)
|
|
|
|
return done()
|
|
|
|
})))
|