Configure PersistorManager to use the new S3 manager for 'aws-sdk'

This commit is contained in:
Simon Detheridge 2020-01-04 17:00:04 +00:00
parent 2ca74fdf15
commit a6d9d34fe3
2 changed files with 8 additions and 2 deletions

View file

@ -13,8 +13,6 @@ if (!settings.filestore.backend) {
switch (settings.filestore.backend) {
case 'aws-sdk':
module.exports = require('./AWSSDKPersistorManager')
break
case 's3':
module.exports = require('./S3PersistorManager')
break

View file

@ -43,6 +43,14 @@ describe('PersistorManager', function() {
expect(PersistorManager.wrappedMethod()).to.equal('S3PersistorManager')
})
it("should implement the S3 wrapped method when 'aws-sdk' is configured", function() {
settings.filestore.backend = 'aws-sdk'
PersistorManager = SandboxedModule.require(modulePath, { requires })
expect(PersistorManager).to.respondTo('wrappedMethod')
expect(PersistorManager.wrappedMethod()).to.equal('S3PersistorManager')
})
it('should implement the FS wrapped method when FS is configured', function() {
settings.filestore.backend = 'fs'
PersistorManager = SandboxedModule.require(modulePath, { requires })