Skip to content

Commit

Permalink
Update GridFSBucketStorageAdapter.spec.js
Browse files Browse the repository at this point in the history
  • Loading branch information
dblythy committed May 19, 2023
1 parent 1a52518 commit db0cf67
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/GridFSBucketStorageAdapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ describe_only_db('mongo')('GridFSBucket', () => {
await db.dropDatabase();
});

it('should connect to mongo with the supported database options', async () => {
const databaseURI = 'mongodb://localhost:27017/parse';
const gfsAdapter = new GridFSBucketAdapter(databaseURI, {
retryWrites: true,
// these are not supported by the mongo client
enableSchemaHooks: true,
schemaCacheTtl: 5000,
maxTimeMS: 30000,
});

const db = await gfsAdapter._connect();
const status = await db.admin().serverStatus();
expect(status.connections.current > 0).toEqual(true);
expect(db.options?.retryWrites).toEqual(true);
});

it('should save an encrypted file that can only be decrypted by a GridFS adapter with the encryptionKey', async () => {
const unencryptedAdapter = new GridFSBucketAdapter(databaseURI);
const encryptedAdapter = new GridFSBucketAdapter(
Expand Down

0 comments on commit db0cf67

Please sign in to comment.