mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
Fix plugin store API tests
This commit is contained in:
parent
74d28790ab
commit
6126dce3c5
@ -13,6 +13,7 @@ describe('init()', () => {
|
||||
it('initializes correctly', async () => {
|
||||
const result = plugin.init({ name: PLUGIN });
|
||||
expect(Object.keys(result.store).sort()).toEqual([
|
||||
'clear',
|
||||
'getItem',
|
||||
'hasItem',
|
||||
'removeItem',
|
||||
@ -38,5 +39,14 @@ describe('store.*', () => {
|
||||
await p.store.removeItem('color');
|
||||
expect(await p.store.hasItem('color')).toBe(false);
|
||||
expect(await p.store.getItem('color')).toBeNull();
|
||||
|
||||
// Clear it
|
||||
await p.store.setItem('a', 'a');
|
||||
await p.store.setItem('b', 'b');
|
||||
await p.store.setItem('c', 'c');
|
||||
await p.store.clear();
|
||||
expect(await p.store.getItem('a')).toBeNull();
|
||||
expect(await p.store.getItem('b')).toBeNull();
|
||||
expect(await p.store.getItem('c')).toBeNull();
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user