auto-claude: subtask-2-1 - Create tests for cache.ts (TTL, get/set, expiration logic)

- Created comprehensive test suite for cache.ts covering:
  - set() and get() operations with various data types
  - TTL expiration logic (default, custom, and edge cases)
  - has() method for checking key existence
  - delete() method for removing individual keys
  - clear() method for removing all keys
  - Expiration boundary testing
  - Different TTL values for different items
  - TTL reset when items are overwritten
- Fixed vitest.config.ts to include src/utils/** tests
- Fixed tsconfig.json to include src/utils/** files
- Used vi.useFakeTimers() for deterministic time-based testing
- All tests properly isolated with beforeEach/afterEach hooks

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-25 06:38:18 +01:00
co-authored by Claude Sonnet 4.5
parent 3377744111
commit aaaa60f5db
8 changed files with 579 additions and 6 deletions
+4 -1
View File
@@ -81,4 +81,7 @@ supabase/.temp/
.history/
# Source images (originals before optimization)
source-images/
source-images/
# Auto Claude data directory
.auto-claude/