diff --git a/lib/cache.test.ts b/lib/cache.test.ts index d3e5790a..8151d70a 100644 --- a/lib/cache.test.ts +++ b/lib/cache.test.ts @@ -403,6 +403,21 @@ describe('TTLCache', () => { cache.destroy(); }); + it('stores and retrieves multidimensional array values', () => { + const cache = new TTLCache(); + + const matrix = [ + [1, 2], + [3, 4], + ]; + + cache.set('matrix', matrix, 60_000); + + expect(cache.get('matrix')).toEqual(matrix); + + cache.destroy(); + }); + it('stores and retrieves nested object values', () => { const cache = new TTLCache<{ user: { id: number; name: string };