31 lines
849 B
TypeScript
31 lines
849 B
TypeScript
import { describe, it, expect, beforeEach } from 'vitest';
|
|
|
|
import { StoreRemoteHTTP } from '~/src/storage/store-remote-http.js';
|
|
import { Encrypter } from '~/src/utils/encrypter';
|
|
import { PrivateKey } from '@xocash/primitives';
|
|
|
|
describe('StoreRemoteHTTP', () => {
|
|
describe('test', () => {
|
|
it('test', async () => {
|
|
const privateKey = PrivateKey.generateRandom();
|
|
const encrypter = await Encrypter.generateRandom();
|
|
const storeHTTP = await StoreRemoteHTTP.from(
|
|
'http://localhost:3000/store/',
|
|
privateKey,
|
|
encrypter,
|
|
);
|
|
|
|
// const keys = await storeHTTP.keys();
|
|
|
|
// console.log(keys);
|
|
|
|
await storeHTTP.set('someValue', { someThing: 'asd' });
|
|
await storeHTTP.set('someOtherValue', { someThing: 'asd' });
|
|
|
|
console.error(await storeHTTP.keys());
|
|
});
|
|
});
|
|
});
|
|
|
|
//
|