feat(bucket): expose the underlying S3 client through getStorageClient()
This commit is contained in:
@@ -24,6 +24,17 @@ tap.test('should create a valid smartbucket', async () => {
|
||||
expect(myBucket.name).toEqual(bucketName);
|
||||
});
|
||||
|
||||
tap.test('should expose the underlying S3 client via getStorageClient()', async () => {
|
||||
const client = myBucket.getStorageClient();
|
||||
expect(client).toBeDefined();
|
||||
expect(typeof (client as any).send).toEqual('function');
|
||||
// The returned client must be the exact same instance as the parent
|
||||
// SmartBucket's storageClient — not a copy. Use identity comparison
|
||||
// because the S3Client contains circular references and cannot be
|
||||
// deep-compared by tapbundle's toEqual.
|
||||
expect(client === testSmartbucket.storageClient).toBeTrue();
|
||||
});
|
||||
|
||||
tap.test('should clean all contents', async () => {
|
||||
await myBucket.cleanAllContents();
|
||||
expect(await myBucket.fastExists({ path: 'hithere/socool.txt' })).toBeFalse();
|
||||
|
||||
Reference in New Issue
Block a user