fix(core): update

This commit is contained in:
2023-08-03 19:22:34 +02:00
parent 1664eee3fe
commit a12418ba9c
18 changed files with 2670 additions and 27032 deletions

View File

@@ -1,25 +1,24 @@
import { expect, tap } from '@pushrocks/tapbundle';
import { expect, tap } from '@push.rocks/tapbundle';
import * as npmextra from '../ts/index';
import * as npmextra from '../ts/index.js';
let myKeyValueStore: npmextra.KeyValueStore;
tap.test('should create a keyValueStore', async () => {
myKeyValueStore = new npmextra.KeyValueStore('custom', 'test');
expect(myKeyValueStore).to.be.instanceof(npmextra.KeyValueStore);
expect(myKeyValueStore).toBeInstanceOf(npmextra.KeyValueStore);
});
tap.test('expect result to be empty', async () => {
let result = myKeyValueStore.readAll();
// tslint:disable-next-line:no-unused-expression
expect(result).to.be.empty;
let result = await myKeyValueStore.readAll();
expect(JSON.stringify(result)).toEqual('{}');
});
tap.test('expect to add an object to the kv Store', async () => {
await myKeyValueStore.writeAll({
myKey: 'myValue',
});
await expect(myKeyValueStore.readKey('myKey')).to.eventually.equal('myValue');
await expect(await myKeyValueStore.readKey('myKey')).toEqual('myValue');
});
tap.start();