webstore/test/test.browser.ts
2020-07-09 23:03:01 +00:00

25 lines
588 B
TypeScript

import { expect, tap } from '@pushrocks/tapbundle';
import * as webstore from '../ts/index';
let testWebstore: webstore.WebStore;
tap.test('first test', async () => {
testWebstore = new webstore.WebStore({
storeName: 'mystore'
});
expect(testWebstore).to.be.instanceOf(webstore.WebStore);
});
tap.test('should init the database', async () => {
await testWebstore.init();
});
tap.test('should store a value', async () => {
await testWebstore.set('testProp1', {
wow: 'wowVal'
});
console.log(JSON.stringify(await testWebstore.get('testProp1')));
});
tap.start();