Skip to content

Commit de6701b

Browse files
authored
test(cache): verify multidimensional array values (JhaSourav07#2033)
## Description Fixes JhaSourav07#1396 Adds a test verifying that `TTLCache` correctly stores and retrieves complex multidimensional array values. The test ensures nested array structures are preserved exactly when fetched from the cache. ## Pillar * [ ] 🎨 Pillar 1 — New Theme Design * [ ] 📐 Pillar 2 — Geometric SVG Improvement * [ ] 🕐 Pillar 3 — Timezone Logic Optimization * [x] 🛠️ Other (Bug fix, refactoring, docs) ## Visual Preview N/A (test-only change) ## Checklist before requesting a review: * [x] I have read the `CONTRIBUTING.md` file. * [x] I have tested these changes locally (`npm run test -- lib/cache.test.ts`). * [ ] I have run `npm run format` and `npm run lint` locally and resolved all errors (CI will fail otherwise). * [x] My commits follow the Conventional Commits format (e.g., `feat(themes): ...`, `fix(calculate): ...`). * [ ] I have updated `README.md` if I added a new theme or URL parameter. * [x] I have started the repo. * [x] I have made sure that i have only one commit to merge in this PR. * [ ] The SVG output matches the CommitPulse "premium quality" aesthetic standard (not applicable — test-only change). * [x] (Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.
2 parents d72d500 + f1f6e41 commit de6701b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/cache.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,11 +409,15 @@ describe('TTLCache', () => {
409409
const matrix = [
410410
[1, 2],
411411
[3, 4],
412+
[5, 6],
412413
];
413414

414415
cache.set('matrix', matrix, 60_000);
415416

416-
expect(cache.get('matrix')).toEqual(matrix);
417+
const cached = cache.get('matrix');
418+
419+
expect(cached).toEqual(matrix);
420+
expect(cached?.[2]?.[1]).toBe(6);
417421

418422
cache.destroy();
419423
});

0 commit comments

Comments
 (0)