Skip to content

Commit

Permalink
deletePrefix: more detailed test
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldschilly committed Jun 26, 2024
1 parent 8b8ddfc commit 19eb826
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion __tests__/test-lru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,20 @@ describe.each(modes)(`%s`, ({ fallback }) => {
LS.set('key456', '2');
LS.set('other987', '3');
LS.set('key789', '4');
LS.set('other_foo', '5');
LS.set('key99', '6');
LS.set('other/bar', '7');
LS.set('baz', '8');
LS.deletePrefix('other');
expect(LS.has('other987')).toBe(false);
expect(LS.has('other_foo')).toBe(false);
expect(LS.has('other/bar')).toBe(false);
expect(LS.has('key123')).toBe(true);
expect(LS.has('key99')).toBe(true);
expect(LS.get('other987')).toBe(null);
expect(LS.get('key789')).toBe('4');
expect(LS.size()).toBe(3);
expect(LS.get('baz')).toBe('8');
expect(LS.size()).toBe(5);
});

test(`${mode} keys`, () => {
Expand Down

0 comments on commit 19eb826

Please sign in to comment.