fix(core): update

This commit is contained in:
2020-09-18 10:12:02 +00:00
parent 068199b5e9
commit 6bd3bd4f37
6 changed files with 1206 additions and 1020 deletions

View File

@@ -6,7 +6,7 @@ let testWebstore: webstore.WebStore;
tap.test('first test', async () => {
testWebstore = new webstore.WebStore({
dbName: 'mytest-db',
storeName: 'mytest-store'
storeName: 'mytest-store',
});
expect(testWebstore).to.be.instanceOf(webstore.WebStore);
});
@@ -20,24 +20,22 @@ tap.test('should allow storing a string', async () => {
expect(await testWebstore.get('mystring')).to.equal('heythere');
});
tap.test('should allow storing an object', async () => {
await testWebstore.set('testProp1', {
wow: 'wowVal'
wow: 'wowVal',
});
console.log(JSON.stringify(await testWebstore.get('testProp1')));
});
tap.test('should overwrite a value', async () => {
await testWebstore.set('testProp1', {
wow: 'wowVal2'
wow: 'wowVal2',
});
console.log(JSON.stringify(await testWebstore.get('testProp1')));
});
tap.test('should correctly check the existence of keys', async () => {
const resultNotThere = await testWebstore.check('notThere');
const resultNotThere = await testWebstore.check('notThere');
const resultThere = await testWebstore.check('testProp1');
expect(resultNotThere).to.be.false;
expect(resultThere).to.be.true;