webstore/test/test.browser.ts

25 lines
588 B
TypeScript
Raw Normal View History

2020-07-09 22:30:33 +00:00
import { expect, tap } from '@pushrocks/tapbundle';
import * as webstore from '../ts/index';
2020-07-09 23:03:01 +00:00
let testWebstore: webstore.WebStore;
2020-07-09 22:30:33 +00:00
tap.test('first test', async () => {
2020-07-09 23:03:01 +00:00
testWebstore = new webstore.WebStore({
storeName: 'mystore'
});
2020-07-09 22:30:33 +00:00
expect(testWebstore).to.be.instanceOf(webstore.WebStore);
});
2020-07-09 23:03:01 +00:00
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')));
});
2020-07-09 22:30:33 +00:00
tap.start();