From 19eb826a222842db334fb1098ea9810ca0a23091 Mon Sep 17 00:00:00 2001 From: Harald Schilly Date: Wed, 26 Jun 2024 09:59:53 +0200 Subject: [PATCH] deletePrefix: more detailed test --- __tests__/test-lru.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/__tests__/test-lru.ts b/__tests__/test-lru.ts index 6508647..60581bd 100644 --- a/__tests__/test-lru.ts +++ b/__tests__/test-lru.ts @@ -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`, () => {