feat: Update KeyValueStorage interface with entries function

This commit is contained in:
Joachim Van Herwegen
2021-02-25 16:59:14 +01:00
parent 52551ac773
commit 0f00a8dffd
8 changed files with 33 additions and 1 deletions

View File

@@ -13,6 +13,9 @@ describe('A ResourceIdentifierStorage', (): void => {
has: jest.fn(),
set: jest.fn(),
delete: jest.fn(),
entries: jest.fn(async function* (): any {
yield [ 'a', 1 ];
}),
};
storage = new ResourceIdentifierStorage(source);
});
@@ -33,5 +36,8 @@ describe('A ResourceIdentifierStorage', (): void => {
await storage.delete(identifier);
expect(source.delete).toHaveBeenCalledTimes(1);
expect(source.delete).toHaveBeenLastCalledWith(path);
await storage.entries().next();
expect(source.entries).toHaveBeenCalledTimes(1);
});
});