Skip to content

Commit db0cf67

Browse files
committed
Update GridFSBucketStorageAdapter.spec.js
1 parent 1a52518 commit db0cf67

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

spec/GridFSBucketStorageAdapter.spec.js

+16
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@ describe_only_db('mongo')('GridFSBucket', () => {
2020
await db.dropDatabase();
2121
});
2222

23+
it('should connect to mongo with the supported database options', async () => {
24+
const databaseURI = 'mongodb://localhost:27017/parse';
25+
const gfsAdapter = new GridFSBucketAdapter(databaseURI, {
26+
retryWrites: true,
27+
// these are not supported by the mongo client
28+
enableSchemaHooks: true,
29+
schemaCacheTtl: 5000,
30+
maxTimeMS: 30000,
31+
});
32+
33+
const db = await gfsAdapter._connect();
34+
const status = await db.admin().serverStatus();
35+
expect(status.connections.current > 0).toEqual(true);
36+
expect(db.options?.retryWrites).toEqual(true);
37+
});
38+
2339
it('should save an encrypted file that can only be decrypted by a GridFS adapter with the encryptionKey', async () => {
2440
const unencryptedAdapter = new GridFSBucketAdapter(databaseURI);
2541
const encryptedAdapter = new GridFSBucketAdapter(

0 commit comments

Comments
 (0)