smartbucket/test/test.trash.ts

24 lines
876 B
TypeScript

import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
import { Qenv } from '@push.rocks/qenv';
import * as smartbucket from '../ts/index.js';
const testQenv = new Qenv('./', './.nogit/');
let testSmartbucket: smartbucket.SmartBucket;
let myBucket: smartbucket.Bucket;
let baseDirectory: smartbucket.Directory;
tap.test('should create a valid smartbucket', async () => {
testSmartbucket = new smartbucket.SmartBucket({
accessKey: await testQenv.getEnvVarOnDemand('S3_KEY'),
accessSecret: await testQenv.getEnvVarOnDemand('S3_SECRET'),
endpoint: 's3.eu-central-1.wasabisys.com',
});
expect(testSmartbucket).toBeInstanceOf(smartbucket.SmartBucket);
myBucket = await testSmartbucket.getBucketByName('testzone');
expect(myBucket).toBeInstanceOf(smartbucket.Bucket);
expect(myBucket.name).toEqual('testzone');
});
export default tap.start();