fix: custom database options are not passed to MongoDB GridFS (#7911)

This commit is contained in:
dblythy
2022-04-04 10:04:37 +10:00
committed by Manuel Trezza
parent a169663304
commit b1e5565b22
2 changed files with 24 additions and 2 deletions

View File

@@ -43,6 +43,20 @@ describe('FilesController', () => {
done();
});
it_only_db('mongo')('should pass databaseOptions to GridFSBucketAdapter', async () => {
await reconfigureServer({
databaseURI: 'mongodb://localhost:27017/parse',
filesAdapter: null,
databaseAdapter: null,
databaseOptions: {
retryWrites: true,
},
});
const config = Config.get(Parse.applicationId);
expect(config.database.adapter._mongoOptions.retryWrites).toBeTrue();
expect(config.filesController.adapter._mongoOptions.retryWrites).toBeTrue();
});
it('should create a server log on failure', done => {
const logController = new LoggerController(new WinstonLoggerAdapter());