fix(core): update
This commit is contained in:
5
test/plugins.ts
Normal file
5
test/plugins.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as smartbucket from '@pushrocks/smartbucket';
|
||||
|
||||
export {
|
||||
smartbucket
|
||||
};
|
35
test/test.ts
Normal file
35
test/test.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { expect, tap } from '@pushrocks/tapbundle';
|
||||
import * as plugins from './plugins';
|
||||
|
||||
import * as smarts3 from '../ts/index';
|
||||
|
||||
let testSmarts3Instance: smarts3.Smarts3;
|
||||
|
||||
tap.test('should create a smarts3 instance and run it', async toolsArg => {
|
||||
testSmarts3Instance = new smarts3.Smarts3({
|
||||
port: 3000,
|
||||
cleanSlate: true,
|
||||
});
|
||||
await testSmarts3Instance.start();
|
||||
console.log(`Let the instance run for 2 seconds`);
|
||||
await toolsArg.delayFor(2000);
|
||||
});
|
||||
|
||||
tap.test('should be able to access buckets', async () => {
|
||||
const smartbucketInstance = new plugins.smartbucket.SmartBucket({
|
||||
endpoint: 'localhost',
|
||||
port: 3000,
|
||||
useSsl: false,
|
||||
accessKey: 'S3RVER',
|
||||
accessSecret: 'S3RVER'
|
||||
});
|
||||
const bucket = await smartbucketInstance.createBucket('testbucket');
|
||||
const baseDirectory = await bucket.getBaseDirectory();
|
||||
await baseDirectory.fastStore('subdir/hello.txt', 'hi there!');
|
||||
});
|
||||
|
||||
tap.test('should stop the instance', async () => {
|
||||
await testSmarts3Instance.stop();
|
||||
})
|
||||
|
||||
tap.start();
|
Reference in New Issue
Block a user