@fjell/cache 4.7.39 → 4.7.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,965 @@
1
+
2
+ > @fjell/cache@4.7.41-dev.0 test
3
+ > vitest run --coverage
4
+
5
+
6
+ RUN v4.0.1 /Users/tobrien/gitw/getfjell/cache
7
+ Coverage enabled with v8
8
+
9
+ stderr | tests/eviction/strategies/LFUEvictionStrategy.test.ts > LFUEvictionStrategy > Configuration Validation and Sanitization Tests > should handle invalid configuration values gracefully
10
+ decayFactor must be between 0 and 1, got -0.5. Correcting to 0.
11
+ sketchWidth must be positive, got -10. Correcting to 1024.
12
+ sketchDepth must be positive, got 0. Correcting to 4.
13
+
14
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Basic Properties > should have correct implementation type
15
+ (1763111335078) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
16
+
17
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Basic Properties > should report two-layer enabled
18
+ (1763111335079) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
19
+
20
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Basic Properties > should provide access to underlying cache
21
+ (1763111335079) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
22
+
23
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Item Operations > should pass through get operations
24
+ (1763111335079) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
25
+
26
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Item Operations > should pass through set operations and invalidate queries
27
+ (1763111335081) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
28
+
29
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Item Operations > should pass through delete operations and invalidate queries
30
+ (1763111335081) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
31
+
32
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Item Operations > should pass through includes key operations
33
+ (1763111335082) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
34
+
35
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Item Operations > should pass through allIn operations
36
+ (1763111335082) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
37
+
38
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Item Operations > should pass through queryIn operations
39
+ (1763111335082) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
40
+
41
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Item Operations > should pass through contains operations
42
+ (1763111335082) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
43
+
44
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Item Operations > should handle clear operations and metadata
45
+ (1763111335082) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
46
+
47
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Query Operations > should set and get query results with metadata
48
+ (1763111335082) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
49
+
50
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Query Operations > should handle query result expiration based on TTL
51
+ (1763111335082) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
52
+
53
+ stderr | tests/memory/MemoryCacheMap.test.ts > MemoryCacheMap > Constructor with Initial Data > should handle invalid JSON keys in initial data gracefully
54
+ (1763111335088) [ERROR] - [@fjell/cache] [MemoryCacheMap] Failed to parse initial data key [{"keyStr":"invalid-json","error":{}}]
55
+
56
+ stderr | tests/ops/set.test.ts > set operation > input validation > should throw error for undefined key
57
+ (1763111335093) [ERROR] - [@fjell/cache] [set] Key for Set is not a valid ItemKey:
58
+
59
+ stderr | tests/ops/set.test.ts > set operation > input validation > should throw error for empty object key
60
+ (1763111335093) [ERROR] - [@fjell/cache] [set] Key for Set is not a valid ItemKey: {}
61
+
62
+ stderr | tests/ops/set.test.ts > set operation > input validation > should throw error for malformed key
63
+ (1763111335094) [ERROR] - [@fjell/cache] [set] Key for Set is not a valid ItemKey: {"invalid":"key"}
64
+
65
+ stderr | tests/ops/set.test.ts > set operation > input validation > should throw error for incomplete primary key
66
+ (1763111335094) [ERROR] - [@fjell/cache] [set] Key for Set is not a valid ItemKey: {"kt":"test"}
67
+
68
+ stderr | tests/ops/set.test.ts > set operation > input validation > should throw error for incomplete composite key
69
+ (1763111335094) [ERROR] - [@fjell/cache] [set] Key does not match item key: {"kt":"test","pk":"1"} != {"kt":"test","pk":"3","loc":[{"kt":"container","lk":"container1"}]}
70
+
71
+ stderr | tests/ops/set.test.ts > set operation > key matching validation > should throw error when key does not match item key
72
+ (1763111335095) [ERROR] - [@fjell/cache] [set] Key does not match item key: {"kt":"test","pk":"different"} != {"kt":"test","pk":"1"}
73
+
74
+ stderr | tests/ops/set.test.ts > set operation > key matching validation > should throw error when primary key type differs
75
+ (1763111335095) [ERROR] - [@fjell/cache] [set] Key does not match item key: {"kt":"different","pk":"1"} != {"kt":"test","pk":"1"}
76
+
77
+ stderr | tests/ops/set.test.ts > set operation > key matching validation > should throw error when composite key location differs
78
+ (1763111335095) [ERROR] - [@fjell/cache] [set] Key does not match item key: {"kt":"test","pk":"3","loc":[{"kt":"container","lk":"different"}]} != {"kt":"test","pk":"3","loc":[{"kt":"container","lk":"container1"}]}
79
+
80
+ stderr | tests/ops/set.test.ts > set operation > edge cases and error scenarios > should handle null values in key normalization gracefully
81
+ (1763111335100) [ERROR] - [@fjell/cache] [set] Key for Set is not a valid ItemKey: {"kt":"test","pk":null}
82
+
83
+ stderr | tests/ops/set.test.ts > set operation > edge cases and error scenarios > should handle empty string keys as invalid
84
+ (1763111335101) [ERROR] - [@fjell/cache] [set] Key for Set is not a valid ItemKey: {"kt":"test","pk":""}
85
+
86
+ ✓ tests/eviction/strategies/LFUEvictionStrategy.test.ts (50 tests) 65ms
87
+ ✓ tests/ops/set.test.ts (44 tests) 26ms
88
+ ✓ tests/eviction/EvictionStrategyFactory.test.ts (33 tests) 32ms
89
+ ✓ tests/memory/MemoryCacheMap.test.ts (76 tests) 63ms
90
+ stdout | tests/cache/TwoLayerFactory.test.ts > TwoLayerFactory > Auto-Detection > should use provided options in auto-detected cache
91
+ (1763111335154) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"browser/indexedDB","itemTTL":7200,"queryTTL":600,"facetTTL":120}]
92
+ (1763111335154) [INFO] - [@fjell/cache] [TwoLayerFactory] Created two-layer cache from config [{"itemLayerType":"indexedDB","queryTTL":600,"facetTTL":120}]
93
+
94
+ stdout | tests/cache/TwoLayerFactory.test.ts > TwoLayerFactory > Wrapper Functionality > should wrap different cache implementations correctly
95
+ (1763111335155) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
96
+ (1763111335155) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/enhanced","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
97
+
98
+ stdout | tests/cache/TwoLayerFactory.test.ts > TwoLayerFactory > Factory Method Options > should handle custom configurations for each method
99
+ (1763111335155) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":1800,"queryTTL":180,"facetTTL":30}]
100
+ (1763111335156) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"browser/indexedDB","itemTTL":1800,"queryTTL":180,"facetTTL":30}]
101
+
102
+ ✓ tests/examples/enhanced-eviction-examples.test.ts (23 tests) 152ms
103
+ stdout | tests/cache/TwoLayerFactory.test.ts > TwoLayerFactory > Debug and Logging > should handle debug logging in factory creation
104
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
105
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerFactory] Created two-layer cache from config [{"itemLayerType":"memory"}]
106
+
107
+ stdout | tests/cache/TwoLayerFactory.test.ts > TwoLayerFactory > Debug and Logging > should create caches with debug mode enabled
108
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
109
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"browser/indexedDB","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
110
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"browser/localStorage","itemTTL":3600,"queryTTL":180,"facetTTL":30}]
111
+
112
+ stdout | tests/cache/TwoLayerFactory.test.ts > TwoLayerFactory > Factory Performance > should handle concurrent factory calls
113
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
114
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
115
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
116
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
117
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
118
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
119
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
120
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
121
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
122
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
123
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
124
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
125
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
126
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
127
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
128
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
129
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
130
+ (1763111335157) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
131
+ (1763111335158) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
132
+ (1763111335158) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
133
+ (1763111335158) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
134
+ (1763111335158) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
135
+ (1763111335158) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
136
+ (1763111335158) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
137
+ (1763111335158) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
138
+
139
+ ❯ tests/cache/TwoLayerFactory.test.ts (42 tests | 1 failed) 11ms
140
+ ✓ should create memory two-layer cache 1ms
141
+ ✓ should create enhanced memory two-layer cache 0ms
142
+ ✓ should create IndexedDB two-layer cache 0ms
143
+ ✓ should create localStorage two-layer cache with space management 0ms
144
+ ✓ should create sessionStorage two-layer cache 0ms
145
+ ✓ should create hybrid two-layer cache 0ms
146
+ ✓ should create two-layer cache when enabled in config 0ms
147
+ ✓ should create single-layer cache when disabled in config 0ms
148
+ ✓ should handle different item layer types in config 0ms
149
+ ✓ should handle unknown cache types gracefully 0ms
150
+ ✓ should pass layer options correctly 0ms
151
+ ✓ should handle missing options in config 0ms
152
+ × should auto-detect cache type for current environment 3ms
153
+ ✓ should use provided options in auto-detected cache 1ms
154
+ ✓ should handle auto-detection with minimal options 0ms
155
+ ✓ should detect best cache type for different environments 0ms
156
+ ✓ should handle factory creation errors gracefully 0ms
157
+ ✓ should handle invalid configuration gracefully 0ms
158
+ ✓ should handle missing required parameters 0ms
159
+ ✓ should create wrapper around existing cache 0ms
160
+ ✓ should handle wrapping with default options 0ms
161
+ ✓ should wrap different cache implementations correctly 0ms
162
+ ✓ should handle default options for each factory method 0ms
163
+ ✓ should apply storage-specific TTL optimizations 0ms
164
+ ✓ should handle custom configurations for each method 0ms
165
+ ✓ should handle empty configuration objects 0ms
166
+ ✓ should handle partial configuration 0ms
167
+ ✓ should handle nested option configurations 0ms
168
+ ✓ should handle null/undefined types gracefully 0ms
169
+ ✓ should handle empty types array 0ms
170
+ ✓ should handle invalid size configurations 0ms
171
+ ✓ should handle IndexedDB configuration edge cases 0ms
172
+ ✓ should handle storage configuration edge cases 0ms
173
+ ✓ should handle unknown cache types in private createSingleLayerCache 0ms
174
+ ✓ should handle createSingleLayerCache with various options 0ms
175
+ ✓ should handle debug logging in factory creation 0ms
176
+ ✓ should create caches with debug mode enabled 0ms
177
+ ✓ should properly wrap different CacheMap types 0ms
178
+ ✓ should preserve underlying cache properties 0ms
179
+ ✓ should handle cache creation with complex type hierarchies 0ms
180
+ ✓ should create instances efficiently 0ms
181
+ ✓ should handle concurrent factory calls 0ms
182
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Query Operations > should delete query results and metadata
183
+ (1763111335233) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
184
+
185
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Query Operations > should determine query completeness correctly
186
+ (1763111335234) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
187
+
188
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Query Operations > should handle query result with empty item keys
189
+ (1763111335234) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
190
+
191
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Query Invalidation > should invalidate queries containing modified items
192
+ (1763111335234) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
193
+
194
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Query Invalidation > should handle invalidation of non-existent queries gracefully
195
+ (1763111335234) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
196
+
197
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Query Invalidation > should invalidate multiple queries for single item change
198
+ (1763111335235) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
199
+
200
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Statistics and Cleanup > should provide two-layer statistics
201
+ (1763111335235) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
202
+
203
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Statistics and Cleanup > should clean up expired queries
204
+ (1763111335235) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
205
+
206
+ stderr | tests/ops/get.test.ts > get operation > input validation > should throw error for invalid key
207
+ (1763111335269) [ERROR] - [@fjell/core] [validation],[KeyValidator] Invalid key structure in get [{"key":{"invalid":"key"},"coordinate":{"kta":["test"],"scopes":[]}}]
208
+
209
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
210
+
211
+ 🚀 Fjell-Cache Basic Example
212
+ ============================
213
+
214
+ This example demonstrates basic cache operations with User and Task models.
215
+
216
+ Step 1: Setting up cache infrastructure
217
+ --------------------------------------
218
+ ✅ Created cache registry
219
+ ✅ Created mock APIs for users and tasks
220
+
221
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
222
+ ✅ Created cache instances (which are now also instances)
223
+ ✅ Created cache model instances
224
+
225
+ Step 2: Creating test data
226
+ -------------------------
227
+ ✅ Created user: Alice Johnson (alice@example.com)
228
+ ✅ Created user: Bob Smith (bob@example.com)
229
+ ✅ Created task: Setup project repository
230
+ ✅ Created task: Implement user authentication
231
+ ✅ Created test users and tasks
232
+
233
+ Step 3: Cache operations - Fetching all items
234
+ ----------------------------------------------
235
+
236
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
237
+ 📦 Fetching all users from storage...
238
+
239
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
240
+ 📋 Cached 2 users: [ 'Alice Johnson', 'Bob Smith' ]
241
+
242
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
243
+ 📦 Fetching all tasks from storage...
244
+
245
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
246
+ 📋 Cached 2 tasks: [ 'Setup project repository', 'Implement user authentication' ]
247
+
248
+ Step 4: Individual item retrieval
249
+ ---------------------------------
250
+
251
+ stderr | tests/ops/get.test.ts > get operation > when bypassCache is enabled > should handle API errors properly
252
+ (1763111335273) [ERROR] - [@fjell/cache] [get] API request failed [{"key":{"kt":"test","pk":"1"},"error":{}}]
253
+
254
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
255
+ 👤 Retrieved from cache: Alice Johnson (alice@example.com)
256
+
257
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
258
+ 📝 Retrieved from cache: Setup project repository - Status: completed
259
+
260
+ Step 5: Cache behavior demonstration
261
+ -----------------------------------
262
+ 🎯 Second retrieval (should hit cache):
263
+
264
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
265
+ 👤 Retrieved: Alice Johnson (cache hit)
266
+ ✅ Created user: Charlie Brown (charlie@example.com)
267
+ 🎯 New item retrieval (cache miss, will fetch from API):
268
+
269
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
270
+ 🔍 Getting user with key: user-3
271
+
272
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
273
+ 👤 Retrieved: Charlie Brown (fetched from API and cached)
274
+
275
+ Step 6: Cache updates
276
+ --------------------
277
+
278
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
279
+ 🔄 Updated task in cache: Implement user authentication - New status: completed
280
+
281
+ Step 7: Query operations
282
+ -----------------------
283
+
284
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
285
+ 📦 Fetching all tasks from storage...
286
+
287
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
288
+ 🔍 Found 2 tasks through cache query
289
+
290
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
291
+ 📝 Retrieved one task: Setup project repository
292
+
293
+ Step 8: Cache management
294
+ -----------------------
295
+ 📊 Cache Statistics:
296
+ 👥 Users in cache: 2
297
+ 📝 Tasks in cache: 2
298
+ 🎯 User cache coordinate: user
299
+ 🎯 Task cache coordinate: task
300
+
301
+ Step 9: Cleanup demonstration
302
+ -----------------------------
303
+ 🗑️ Removed user from storage
304
+
305
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
306
+ 🎯 Cache still contains removed user: Charlie Brown
307
+
308
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test branch patterns that mirror the example structure for increased coverage
309
+ 📋 Fresh fetch shows 2 users (cache updated)
310
+
311
+ 🎉 Basic Cache Example Complete!
312
+ ================================
313
+
314
+ Key concepts demonstrated:
315
+ • Cache creation with registry and instances
316
+ • Basic cache operations (get, set, all, find, one)
317
+ • Cache hits vs misses
318
+ • Cache updates and management
319
+ • Integration with mock storage APIs
320
+ • Cache lifecycle and data consistency
321
+
322
+
323
+ stderr | tests/ops/get.test.ts > get operation > error handling > should propagate API errors
324
+ (1763111335279) [ERROR] - [@fjell/cache] [get] Error getting item for key [{"key":{"kt":"test","pk":"1"},"message":"API failure","stack":"Error: API failure
325
+ at /Users/tobrien/gitw/getfjell/cache/tests/ops/get.test.ts:306:24
326
+ at file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:157:11
327
+ at file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:753:26
328
+ at file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1636:20
329
+ at new Promise (<anonymous>)
330
+ at runWithTimeout (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1602:10)
331
+ at runTest (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1309:12)
332
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
333
+ at runSuite (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1468:8)
334
+ at runSuite (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1468:8)
335
+ at runSuite (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1468:8)
336
+ at runFiles (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1526:3)
337
+ at startTests (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1559:3)
338
+ at file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/base.BYPMk0VN.js:76:64
339
+ at withEnv (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/base.BYPMk0VN.js:57:3)
340
+ at run (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/base.BYPMk0VN.js:72:144)
341
+ at runBaseTests (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/base.BYPMk0VN.js:122:2)
342
+ at executeTests (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/init-forks.WglB-sfY.js:24:4)
343
+ at execute (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/init.94FWN9pW.js:99:3)
344
+ at process.onMessage (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/init.94FWN9pW.js:164:20)"}]
345
+
346
+ stderr | tests/ops/get.test.ts > get operation > error handling > should propagate API errors even with TTL configured
347
+ (1763111335280) [ERROR] - [@fjell/cache] [get] Error getting item for key [{"key":{"kt":"test","pk":"1"},"message":"Network error","stack":"Error: Network error
348
+ at /Users/tobrien/gitw/getfjell/cache/tests/ops/get.test.ts:317:24
349
+ at file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:157:11
350
+ at file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:753:26
351
+ at file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1636:20
352
+ at new Promise (<anonymous>)
353
+ at runWithTimeout (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1602:10)
354
+ at runTest (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1309:12)
355
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
356
+ at runSuite (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1468:8)
357
+ at runSuite (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1468:8)
358
+ at runSuite (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1468:8)
359
+ at runFiles (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1526:3)
360
+ at startTests (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1559:3)
361
+ at file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/base.BYPMk0VN.js:76:64
362
+ at withEnv (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/base.BYPMk0VN.js:57:3)
363
+ at run (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/base.BYPMk0VN.js:72:144)
364
+ at runBaseTests (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/base.BYPMk0VN.js:122:2)
365
+ at executeTests (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/init-forks.WglB-sfY.js:24:4)
366
+ at execute (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/init.94FWN9pW.js:99:3)
367
+ at process.onMessage (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/init.94FWN9pW.js:164:20)"}]
368
+
369
+ stderr | tests/ops/get.test.ts > get operation > error handling > should handle API errors with stack trace
370
+ (1763111335280) [ERROR] - [@fjell/cache] [get] Error getting item for key [{"key":{"kt":"test","pk":"1"},"message":"Detailed API error","stack":"Error stack trace"}]
371
+
372
+ stderr | tests/memory/EnhancedMemoryCacheMap.test.ts > EnhancedMemoryCacheMap > Constructor with initial data > should handle invalid initial data keys gracefully
373
+ (1763111335281) [ERROR] - [@fjell/cache] [EnhancedMemoryCacheMap] Failed to parse initial data key [{"keyStr":"invalid-json-key","error":{}}]
374
+
375
+ stderr | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should verify cache operations with empty data scenarios
376
+ (1763111335285) [ERROR] - [@fjell/cache] [get] Error getting item for key [{"key":{"kt":"test","pk":"missing"},"message":"Not found: missing","stack":"Error: Not found: missing
377
+ at Object.get (/Users/tobrien/gitw/getfjell/cache/tests/examples/basic-cache-example.integration.test.ts:98:37)
378
+ at executeGetLogic (/Users/tobrien/gitw/getfjell/cache/src/ops/get.ts:166:24)
379
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
380
+ at /Users/tobrien/gitw/getfjell/cache/src/ops/get.ts:70:14
381
+ at /Users/tobrien/gitw/getfjell/cache/node_modules/@fjell/core/dist/index.js:1872:22
382
+ at get (/Users/tobrien/gitw/getfjell/cache/src/ops/get.ts:74:18)"}]
383
+
384
+ stdout | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should test cache memory behavior and performance characteristics
385
+ First call: 1.23ms, Cache hit: 0.34ms
386
+
387
+ ✓ tests/ops/get.test.ts (34 tests) 19ms
388
+ stdout | tests/examples/cache-type-configurations-example.integration.test.ts > Cache Type Configurations Example Integration > should import and execute cache type configurations example without errors
389
+ 🚀 Cache Type Configuration Examples
390
+
391
+ 1️⃣ Memory Cache Configuration
392
+ Best for: Fast access, temporary data, development
393
+ ✅ Memory cache configured with:
394
+ - Max items: 1000
395
+ - TTL: undefinedms (0s)
396
+ - Debug logging: true
397
+ - Auto sync: true
398
+ - Max retries: 3
399
+
400
+ 2️⃣ IndexedDB Cache Configuration
401
+ Best for: Large datasets, offline capability, persistent storage
402
+ ✅ IndexedDB cache configured with:
403
+ - Database: UserAppCache
404
+ - Version: 2
405
+ - Store: users
406
+ - Debug logging: false
407
+ - Max retries: 5
408
+ - Retry delay: 2000ms
409
+
410
+ 3️⃣ localStorage Cache Configuration
411
+ Best for: User preferences, settings, moderate-sized persistent data
412
+ ✅ localStorage cache configured with:
413
+ - Key prefix: "myapp:users:"
414
+ - Compression: true
415
+ - Auto sync: false
416
+ - Max retries: 2
417
+ - Default expiration: 7200000ms (7200s)
418
+
419
+ 4️⃣ Environment-Based Configuration
420
+ Automatically select optimal cache based on environment
421
+ 🌐 Browser with IndexedDB detected - using IndexedDB
422
+ ✅ Optimal configuration selected
423
+
424
+
425
+ stdout | tests/examples/cache-type-configurations-example.integration.test.ts > Cache Type Configurations Example Integration > should import and execute cache type configurations example without errors
426
+ 🌐 Browser with IndexedDB detected - using IndexedDB
427
+
428
+ ✓ tests/ops/retrieve.test.ts (37 tests) 20ms
429
+ ✓ tests/examples/cache-map-example.integration.test.ts (1 test) 17ms
430
+ ✓ tests/examples/cache-type-configurations-example.integration.test.ts (1 test) 296ms
431
+ ✓ tests/memory/EnhancedMemoryCacheMap.test.ts (108 tests | 12 skipped) 22ms
432
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Statistics and Cleanup > should handle statistics with mixed expired and valid queries
433
+ (1763111335335) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
434
+
435
+ stderr | tests/integration/CacheIntegration.test.ts > Cache Integration Tests > Error Handling and Edge Cases > should handle storage errors gracefully in browser implementations
436
+ (1763111335347) [ERROR] - [@fjell/cache] [LocalStorageCacheMap] Error storing to localStorage (attempt 1/3) [{"key":{"kt":"test","pk":"1"},"value":{"key":{"kt":"test","pk":"1"},"id":"1","name":"Test Item","value":100},"error":{},"isLastAttempt":false}]
437
+ (1763111335347) [ERROR] - [@fjell/cache] [LocalStorageCacheMap] Error storing to localStorage (attempt 2/3) [{"key":{"kt":"test","pk":"1"},"value":{"key":{"kt":"test","pk":"1"},"id":"1","name":"Test Item","value":100},"error":{},"isLastAttempt":false}]
438
+ (1763111335348) [ERROR] - [@fjell/cache] [LocalStorageCacheMap] Error storing to localStorage (attempt 3/3) [{"key":{"kt":"test","pk":"1"},"value":{"key":{"kt":"test","pk":"1"},"id":"1","name":"Test Item","value":100},"error":{},"isLastAttempt":true}]
439
+
440
+ stderr | tests/contained/Cache.test.ts > Combined Item Cache Tests > should throw error when setting item with mismatched keys
441
+ (1763111335353) [ERROR] - [@fjell/cache] [set] Key does not match item key: {"kt":"test","pk":"123e4567-e89b-12d3-a456-426614174000"} != {"kt":"test","pk":"123e4567-e89b-12d3-a456-426614174000","loc":[{"kt":"container","lk":"123e4567-e89b-12d3-a456-426614174100"}]}
442
+
443
+ ✓ tests/integration/CacheIntegration.test.ts (15 tests) 16ms
444
+ ✓ tests/contained/Cache.test.ts (16 tests) 13ms
445
+ stdout | tests/cache/layers/QueryCache.test.ts > QueryCache > Debug Logging > should log operations when debug is enabled
446
+ [QueryCache] Stored query result: debug-query
447
+ - Items: 1
448
+ - Complete: true
449
+ - TTL: 300s
450
+ - Expires: 2025-11-14T09:13:55.375Z
451
+
452
+ stdout | tests/cache/layers/QueryCache.test.ts > QueryCache > Debug Logging > should log operations when debug is enabled
453
+ [QueryCache] Cache hit for query: debug-query (1 items, complete: true)
454
+
455
+ stdout | tests/cache/layers/QueryCache.test.ts > QueryCache > Debug Logging > should log operations when debug is enabled
456
+ [QueryCache] Invalidated 1 queries matching pattern: debug.*
457
+
458
+ stdout | tests/cache/layers/QueryCache.test.ts > QueryCache > Debug Logging > should log operations when debug is enabled
459
+ [QueryCache] Cache miss for query: debug-query
460
+
461
+ stdout | tests/cache/layers/QueryCache.test.ts > QueryCache > Debug Logging > should log operations when debug is enabled
462
+ [QueryCache] Cleared 0 query results
463
+
464
+ stderr | tests/events/CacheEventEmitter.test.ts > CacheEventEmitter > event emission > should handle listener errors gracefully
465
+ Error in cache event listener: Error: Test error
466
+ at /Users/tobrien/gitw/getfjell/cache/tests/events/CacheEventEmitter.test.ts:125:15
467
+ at Mock (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/spy/dist/index.js:266:34)
468
+ at CacheEventEmitter.emitToSubscription (/Users/tobrien/gitw/getfjell/cache/src/events/CacheEventEmitter.ts:328:9)
469
+ at CacheEventEmitter.emit (/Users/tobrien/gitw/getfjell/cache/src/events/CacheEventEmitter.ts:182:14)
470
+ at /Users/tobrien/gitw/getfjell/cache/tests/events/CacheEventEmitter.test.ts:136:28
471
+ at Proxy.assertThrows (file:///Users/tobrien/gitw/getfjell/cache/node_modules/chai/index.js:2800:5)
472
+ at Proxy.methodWrapper (file:///Users/tobrien/gitw/getfjell/cache/node_modules/chai/index.js:1701:25)
473
+ at Proxy.<anonymous> (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/expect/dist/index.js:1145:12)
474
+ at Proxy.overwritingMethodWrapper (file:///Users/tobrien/gitw/getfjell/cache/node_modules/chai/index.js:1751:33)
475
+ at Proxy.<anonymous> (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/expect/dist/index.js:1481:16)
476
+ at Proxy.<anonymous> (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/expect/dist/index.js:1086:14)
477
+ at Proxy.methodWrapper (file:///Users/tobrien/gitw/getfjell/cache/node_modules/chai/index.js:1701:25)
478
+ at /Users/tobrien/gitw/getfjell/cache/tests/events/CacheEventEmitter.test.ts:136:45
479
+ at file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:157:11
480
+ at file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:753:26
481
+ at file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1636:20
482
+ at new Promise (<anonymous>)
483
+ at runWithTimeout (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1602:10)
484
+ at runTest (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1309:12)
485
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
486
+ at runSuite (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1468:8)
487
+ at runSuite (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1468:8)
488
+ at runSuite (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1468:8)
489
+ at runFiles (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1526:3)
490
+ at startTests (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:1559:3)
491
+ at file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/base.BYPMk0VN.js:76:64
492
+ at withEnv (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/base.BYPMk0VN.js:57:3)
493
+ at run (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/base.BYPMk0VN.js:72:144)
494
+ at runBaseTests (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/base.BYPMk0VN.js:122:2)
495
+ at executeTests (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/init-forks.WglB-sfY.js:24:4)
496
+ at execute (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/init.94FWN9pW.js:99:3)
497
+ at process.onMessage (file:///Users/tobrien/gitw/getfjell/cache/node_modules/vitest/dist/chunks/init.94FWN9pW.js:164:20)
498
+
499
+ ✓ tests/events/CacheEventEmitter.test.ts (41 tests) 14ms
500
+ stderr | tests/ops/one.test.ts > one operation > when bypassCache is enabled > should handle API errors properly
501
+ (1763111335435) [ERROR] - [@fjell/cache] [one] API request failed [{"query":{"compoundCondition":{"compoundType":"AND","conditions":[{"column":"id","value":"1","operator":"=="}]}},"locations":[],"error":{}}]
502
+
503
+ ✓ tests/eviction/EvictionStrategyValidation.test.ts (82 tests) 13ms
504
+ stderr | tests/utils/EvictionStrategies.edge-cases.test.ts > Eviction Strategies Edge Cases and Comprehensive Tests > createEvictionStrategy factory edge cases > should handle extreme configuration values for enhanced strategies
505
+ sketchWidth should be at least 16 for optimal performance, got 1. Correcting to 16.
506
+ adaptiveLearningRate must be between 0 and 10, got 100. Correcting to 10.
507
+
508
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Metadata Provider Methods > should delegate metadata operations to underlying cache
509
+ (1763111335436) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
510
+
511
+ stderr | tests/utils/EvictionStrategies.edge-cases.test.ts > Eviction Strategies Edge Cases and Comprehensive Tests > createEvictionStrategy factory edge cases > should handle invalid configuration values gracefully
512
+ decayFactor must be between 0 and 1, got -0.5. Correcting to 0.
513
+ sketchWidth must be positive, got 0. Correcting to 1024.
514
+ sketchDepth must be positive, got -1. Correcting to 4.
515
+ decayFactor must be between 0 and 1, got -0.5. Correcting to 0.
516
+ sketchWidth must be positive, got 0. Correcting to 1024.
517
+ sketchDepth must be positive, got -1. Correcting to 4.
518
+
519
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Metadata Provider Methods > should handle metadata operations when underlying cache doesn't support them
520
+ (1763111335437) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
521
+
522
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Metadata Provider Methods > should get current size from underlying cache
523
+ (1763111335437) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
524
+
525
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Metadata Provider Methods > should get size limits from underlying cache
526
+ (1763111335437) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
527
+
528
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Cache Map Interface Compliance > should pass through keys() operation
529
+ (1763111335437) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
530
+
531
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Cache Map Interface Compliance > should pass through values() operation
532
+ (1763111335438) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
533
+
534
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Cache Map Interface Compliance > should create a clone of the cache
535
+ (1763111335438) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
536
+
537
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Cache Map Interface Compliance > should create a clone of the cache
538
+ (1763111335438) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
539
+
540
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Query Metadata Extraction > should extract query type from hash correctly
541
+ (1763111335438) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
542
+
543
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Query Metadata Extraction > should extract filter information from query hash
544
+ (1763111335438) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
545
+
546
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Query Metadata Extraction > should handle malformed query hashes gracefully
547
+ (1763111335438) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
548
+
549
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > CacheMap Abstract Methods > should implement invalidateItemKeys
550
+ (1763111335439) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
551
+
552
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > CacheMap Abstract Methods > should implement invalidateLocation
553
+ (1763111335439) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
554
+
555
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > CacheMap Abstract Methods > should implement clearQueryResults
556
+ (1763111335439) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
557
+
558
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Error Handling > should handle underlying cache errors gracefully
559
+ (1763111335439) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
560
+
561
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Error Handling > should handle query operations when queries don't exist
562
+ (1763111335440) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
563
+
564
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Options and Configuration > should use default options when not provided
565
+ (1763111335440) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
566
+
567
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Options and Configuration > should respect debug option in logging
568
+ (1763111335440) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
569
+
570
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Options and Configuration > should respect debug option in logging
571
+ (1763111335440) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
572
+
573
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Options and Configuration > should handle different TTL configurations
574
+ (1763111335440) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
575
+
576
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Complex Scenarios > should handle rapid query invalidation and recreation
577
+ (1763111335440) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
578
+
579
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Complex Scenarios > should handle large numbers of queries efficiently
580
+ (1763111335441) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
581
+
582
+ stdout | tests/cache/layers/TwoLayerCacheMap.test.ts > TwoLayerCacheMap > Complex Scenarios > should handle query results with complex item key structures
583
+ (1763111335442) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
584
+
585
+ stderr | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should handle various API response scenarios and edge cases
586
+ (1763111335454) [ERROR] - [@fjell/cache] [get] Error getting item for key [{"key":{"kt":"edge","pk":"null-error"},"message":"Null error test","stack":"Error: Null error test
587
+ at Object.get (/Users/tobrien/gitw/getfjell/cache/tests/examples/basic-cache-example.integration.test.ts:373:35)
588
+ at executeGetLogic (/Users/tobrien/gitw/getfjell/cache/src/ops/get.ts:166:24)
589
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
590
+ at /Users/tobrien/gitw/getfjell/cache/src/ops/get.ts:70:14
591
+ at /Users/tobrien/gitw/getfjell/cache/node_modules/@fjell/core/dist/index.js:1872:22
592
+ at get (/Users/tobrien/gitw/getfjell/cache/src/ops/get.ts:74:18)"}]
593
+
594
+ stderr | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should handle various API response scenarios and edge cases
595
+ (1763111335455) [ERROR] - [@fjell/cache] [get] Error getting item for key [{"key":{"kt":"edge","pk":"undefined-error"},"message":"Undefined error test","stack":"Error: Undefined error test
596
+ at Object.get (/Users/tobrien/gitw/getfjell/cache/tests/examples/basic-cache-example.integration.test.ts:376:35)
597
+ at executeGetLogic (/Users/tobrien/gitw/getfjell/cache/src/ops/get.ts:166:24)
598
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
599
+ at /Users/tobrien/gitw/getfjell/cache/src/ops/get.ts:70:14
600
+ at /Users/tobrien/gitw/getfjell/cache/node_modules/@fjell/core/dist/index.js:1872:22
601
+ at get (/Users/tobrien/gitw/getfjell/cache/src/ops/get.ts:74:18)"}]
602
+
603
+ stderr | tests/examples/basic-cache-example.integration.test.ts > Basic Cache Example Integration Tests > Basic Cache Operations Example > should handle various API response scenarios and edge cases
604
+ (1763111335455) [ERROR] - [@fjell/cache] [get] Error getting item for key [{"key":{"kt":"edge","pk":"missing"},"message":"Edge case item not found: missing","stack":"Error: Edge case item not found: missing
605
+ at Object.get (/Users/tobrien/gitw/getfjell/cache/tests/examples/basic-cache-example.integration.test.ts:378:33)
606
+ at executeGetLogic (/Users/tobrien/gitw/getfjell/cache/src/ops/get.ts:166:24)
607
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
608
+ at /Users/tobrien/gitw/getfjell/cache/src/ops/get.ts:70:14
609
+ at /Users/tobrien/gitw/getfjell/cache/node_modules/@fjell/core/dist/index.js:1872:22
610
+ at get (/Users/tobrien/gitw/getfjell/cache/src/ops/get.ts:74:18)"}]
611
+
612
+ ✓ tests/utils/EvictionStrategies.edge-cases.test.ts (32 tests) 14ms
613
+ ✓ tests/ops/one.test.ts (20 tests) 15ms
614
+ ✓ tests/cache/layers/TwoLayerCacheMap.test.ts (43 tests) 367ms
615
+ ✓ tests/examples/basic-cache-example.integration.test.ts (8 tests) 192ms
616
+ stderr | tests/ops/action.test.ts > action operation > input validation > should throw error for invalid item key
617
+ (1763111335469) [ERROR] - [@fjell/core] [validation],[KeyValidator] Invalid key structure in action [{"key":{"invalid":"key"},"coordinate":{"kta":["test"],"scopes":["container"]}}]
618
+
619
+ stderr | tests/ops/action.test.ts > action operation > input validation > should validate key before any cache operations
620
+ (1763111335471) [ERROR] - [@fjell/core] [validation],[KeyValidator] Invalid key structure in action [{"key":{"kt":"test"},"coordinate":{"kta":["test"],"scopes":["container"]}}]
621
+
622
+ stderr | tests/ops/action.test.ts > action operation > eviction key parsing error handling > should handle malformed evicted keys gracefully
623
+ (1763111335474) [ERROR] - [@fjell/cache] [action] Failed to parse evicted key during deletion [{"evictedKey":"invalid-json","error":"Unexpected token 'i', "invalid-json" is not valid JSON"}]
624
+
625
+ stderr | tests/ops/action.test.ts > action operation > eviction key parsing error handling > should handle malformed evicted keys gracefully
626
+ (1763111335474) [ERROR] - [@fjell/cache] [action] Failed to parse evicted key during deletion [{"evictedKey":"{incomplete json","error":"Expected property name or '}' in JSON at position 1 (line 1 column 2)"}]
627
+
628
+ stderr | tests/ops/action.test.ts > action operation > eviction key parsing error handling > should continue processing when JSON parse fails on evicted keys
629
+ (1763111335474) [ERROR] - [@fjell/cache] [action] Failed to parse evicted key during deletion [{"evictedKey":"undefined","error":""undefined" is not valid JSON"}]
630
+ (1763111335474) [ERROR] - [@fjell/cache] [action] Failed to parse evicted key during deletion [{"evictedKey":"{circular_ref}","error":"Expected property name or '}' in JSON at position 1 (line 1 column 2)"}]
631
+
632
+ stderr | tests/ops/action.test.ts > action operation > eviction key parsing error handling > should continue processing when JSON parse fails on evicted keys
633
+ (1763111335474) [ERROR] - [@fjell/cache] [action] Failed to parse evicted key during deletion [{"evictedKey":"invalid","error":"Unexpected token 'i', "invalid" is not valid JSON"}]
634
+
635
+ ✓ tests/ops/action.test.ts (24 tests) 14ms
636
+ ✓ tests/examples/memory-leak-prevention.integration.test.ts (34 tests) 15ms
637
+ ✓ tests/patterns/StaleWhileRevalidate.test.ts (13 tests) 461ms
638
+ stderr | tests/ops/find-operations.test.ts > Find Operations > find operation with bypassCache enabled > should handle API errors properly
639
+ (1763111335533) [ERROR] - [@fjell/cache] [find] API request failed [{"finder":"by-value","params":{"value":100},"locations":[],"error":{}}]
640
+
641
+ ✓ tests/InstanceFactory.test.ts (63 tests) 14ms
642
+ stderr | tests/ops/find-operations.test.ts > Find Operations > findOne operation with bypassCache enabled > should handle API errors properly
643
+ (1763111335537) [ERROR] - [@fjell/cache] [findOne] API request failed [{"finder":"by-id","finderParams":{"id":"1"},"locations":[],"error":{}}]
644
+
645
+ ✓ tests/ops/find-operations.test.ts (27 tests) 13ms
646
+ stderr | tests/ops/remove.test.ts > remove operation > input validation > should throw error for empty object
647
+ (1763111335579) [ERROR] - [@fjell/core] [validation],[KeyValidator] Invalid key structure in remove [{"key":{},"coordinate":{"kta":["test"],"scopes":[]}}]
648
+
649
+ stderr | tests/ops/remove.test.ts > remove operation > input validation > should throw error for malformed key
650
+ (1763111335580) [ERROR] - [@fjell/core] [validation],[KeyValidator] Invalid key structure in remove [{"key":{"invalid":"key"},"coordinate":{"kta":["test"],"scopes":[]}}]
651
+
652
+ stderr | tests/ops/remove.test.ts > remove operation > input validation > should throw error for incomplete primary key
653
+ (1763111335580) [ERROR] - [@fjell/core] [validation],[KeyValidator] Invalid key structure in remove [{"key":{"kt":"test"},"coordinate":{"kta":["test"],"scopes":[]}}]
654
+
655
+ stderr | tests/ops/remove.test.ts > remove operation > input validation > should throw error for null pk
656
+ (1763111335581) [ERROR] - [@fjell/cache] [remove] Key for Remove is not a valid ItemKey: {"kt":"test","pk":null}
657
+
658
+ stderr | tests/ops/remove.test.ts > remove operation > input validation > should throw error for empty string pk
659
+ (1763111335581) [ERROR] - [@fjell/cache] [remove] Key for Remove is not a valid ItemKey: {"kt":"test","pk":""}
660
+
661
+ stderr | tests/ops/remove.test.ts > remove operation > error handling > should propagate API errors and not delete from cache
662
+ (1763111335583) [ERROR] - [@fjell/cache] [remove] Error deleting item [{"error":{}}]
663
+
664
+ stdout | tests/cache/layers/QueryCache.test.ts > QueryCache > Cleanup Operations > should handle cleanup with debug logging enabled
665
+ [QueryCache] Stored query result: debug-query1
666
+ - Items: 1
667
+ - Complete: true
668
+ - TTL: 0.05s
669
+ - Expires: 2025-11-14T09:08:55.631Z
670
+
671
+ stdout | tests/cache/layers/QueryCache.test.ts > QueryCache > Cleanup Operations > should handle cleanup with debug logging enabled
672
+ [QueryCache] Stored query result: debug-query2
673
+ - Items: 1
674
+ - Complete: true
675
+ - TTL: 0.05s
676
+ - Expires: 2025-11-14T09:08:55.631Z
677
+
678
+ stderr | tests/ops/remove.test.ts > remove operation > error handling > should handle network errors
679
+ (1763111335584) [ERROR] - [@fjell/cache] [remove] Error deleting item [{"error":{}}]
680
+
681
+ stderr | tests/ops/remove.test.ts > remove operation > error handling > should handle API errors with additional properties
682
+ (1763111335584) [ERROR] - [@fjell/cache] [remove] Error deleting item [{"error":{}}]
683
+
684
+ stderr | tests/ops/remove.test.ts > remove operation > operation sequence > should not call cache deletion if API call fails
685
+ (1763111335584) [ERROR] - [@fjell/cache] [remove] Error deleting item [{"error":{}}]
686
+
687
+ stderr | tests/ops/remove.test.ts > remove operation > comprehensive error scenarios > should handle API remove throwing synchronously
688
+ (1763111335586) [ERROR] - [@fjell/cache] [remove] Error deleting item [{"error":{}}]
689
+
690
+ stderr | tests/ops/update.test.ts > update operation > validation and error handling > should throw error for invalid key
691
+ (1763111335590) [ERROR] - [@fjell/core] [validation],[KeyValidator] Invalid key structure in update [{"key":{"kt":"test"},"coordinate":{"kta":["test"],"scopes":[]}}]
692
+
693
+ stderr | tests/ops/all.test.ts > all operation > when bypassCache is enabled > should handle API errors properly
694
+ (1763111335590) [ERROR] - [@fjell/cache] [all] API request failed [{"query":{"limit":10},"locations":[{"kt":"container","lk":"container1"}],"error":{}}]
695
+
696
+ stderr | tests/ops/update.test.ts > update operation > validation and error handling > should throw error for malformed key
697
+ (1763111335591) [ERROR] - [@fjell/core] [validation],[KeyValidator] Invalid key structure in update [{"key":{"kt":"test"},"coordinate":{"kta":["test"],"scopes":[]}}]
698
+
699
+ stderr | tests/ops/update.test.ts > update operation > validation and error handling > should propagate API errors
700
+ (1763111335591) [ERROR] - [@fjell/cache] [update] Error updating item [{"error":{}}]
701
+
702
+ stderr | tests/ops/update.test.ts > update operation > validation and error handling > should handle network timeouts
703
+ (1763111335592) [ERROR] - [@fjell/cache] [update] Error updating item [{"error":{}}]
704
+
705
+ ✓ tests/ops/remove.test.ts (20 tests) 11ms
706
+ ✓ tests/ops/all.test.ts (17 tests) 12ms
707
+ ✓ tests/ops/update.test.ts (16 tests) 12ms
708
+ stdout | tests/examples/cache-type-configurations-example.test.ts
709
+ 🚀 Cache Type Configuration Examples
710
+
711
+ 1️⃣ Memory Cache Configuration
712
+ Best for: Fast access, temporary data, development
713
+ ✅ Memory cache configured with:
714
+ - Max items: 1000
715
+ - TTL: undefinedms (0s)
716
+ - Debug logging: true
717
+ - Auto sync: true
718
+ - Max retries: 3
719
+
720
+ 2️⃣ IndexedDB Cache Configuration
721
+ Best for: Large datasets, offline capability, persistent storage
722
+ ✅ IndexedDB cache configured with:
723
+ - Database: UserAppCache
724
+ - Version: 2
725
+ - Store: users
726
+ - Debug logging: false
727
+ - Max retries: 5
728
+ - Retry delay: 2000ms
729
+
730
+ 3️⃣ localStorage Cache Configuration
731
+ Best for: User preferences, settings, moderate-sized persistent data
732
+ ✅ localStorage cache configured with:
733
+ - Key prefix: "myapp:users:"
734
+ - Compression: true
735
+ - Auto sync: false
736
+ - Max retries: 2
737
+ - Default expiration: 7200000ms (7200s)
738
+
739
+ 4️⃣ Environment-Based Configuration
740
+ Automatically select optimal cache based on environment
741
+ 🖥️ Node.js or limited browser environment - using memory cache
742
+ ✅ Optimal configuration selected
743
+
744
+
745
+ stderr | tests/events/CacheEventIntegration.test.ts > Cache Event Integration > error handling > should continue emitting events even if a listener throws
746
+ Error in cache event listener: Error: Test listener error
747
+ at /Users/tobrien/gitw/getfjell/cache/tests/events/CacheEventIntegration.test.ts:403:15
748
+ at Mock (file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/spy/dist/index.js:266:34)
749
+ at CacheEventEmitter.emitToSubscription (/Users/tobrien/gitw/getfjell/cache/src/events/CacheEventEmitter.ts:328:9)
750
+ at CacheEventEmitter.emit (/Users/tobrien/gitw/getfjell/cache/src/events/CacheEventEmitter.ts:182:14)
751
+ at set (/Users/tobrien/gitw/getfjell/cache/src/ops/set.ts:150:16)
752
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
753
+ at /Users/tobrien/gitw/getfjell/cache/tests/events/CacheEventIntegration.test.ts:413:7
754
+ at file:///Users/tobrien/gitw/getfjell/cache/node_modules/@vitest/runner/dist/index.js:753:20
755
+
756
+ ✓ tests/CacheMap.test.ts (40 tests) 10ms
757
+ ✓ tests/events/CacheEventIntegration.test.ts (15 tests) 13ms
758
+ ✓ tests/events/CacheEventFactory.test.ts (21 tests) 6ms
759
+ ✓ tests/examples/cache-type-configurations-example.test.ts (32 tests) 11ms
760
+ ✓ tests/eviction/strategies/ARCEvictionStrategy.test.ts (41 tests) 9ms
761
+ stderr | tests/primary/Cache.test.ts > PItemCache > should throw error when setting item with mismatched keys
762
+ (1763111335649) [ERROR] - [@fjell/cache] [set] Key does not match item key: {"kt":"whatever","pk":"123e4567-e89b-12d3-a456-426614174000"} != {"kt":"test","pk":"123e4567-e89b-12d3-a456-426614174000"}
763
+
764
+ stdout | tests/integration/CachePoisoningPrevention.test.ts > Cache Poisoning Prevention > should prevent cache poisoning from partial faceted query results
765
+ (1763111335649) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
766
+
767
+ stdout | tests/integration/CachePoisoningPrevention.test.ts > Cache Poisoning Prevention > should prevent cache poisoning from partial faceted query results
768
+ 🧪 Testing Cache Poisoning Prevention...
769
+ 📊 Step 1: Running faceted Graphics Report query...
770
+
771
+ stdout | tests/integration/CachePoisoningPrevention.test.ts > Cache Poisoning Prevention > should prevent cache poisoning from partial faceted query results
772
+ 📝 Faceted query returned 1 item(s):
773
+ - GPH: Graphics
774
+ 📊 Step 2: Running complete query for all phases...
775
+
776
+ stdout | tests/integration/CachePoisoningPrevention.test.ts > Cache Poisoning Prevention > should prevent cache poisoning from partial faceted query results
777
+ 📝 Complete query returned 5 items:
778
+ - GPH: Graphics
779
+ - CUT: Cutting
780
+ - FIN: Finishing
781
+ - QC: Quality Control
782
+ - SHP: Shipping
783
+ ✅ Cache poisoning prevention successful!
784
+ Faceted query (1 item) did NOT poison complete query (5 items)
785
+
786
+ stdout | tests/integration/CachePoisoningPrevention.test.ts > Cache Poisoning Prevention > should cache complete queries but not use them for partial results
787
+ (1763111335654) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
788
+
789
+ stdout | tests/integration/CachePoisoningPrevention.test.ts > Cache Poisoning Prevention > should cache complete queries but not use them for partial results
790
+ 🧪 Testing Query Completeness Isolation...
791
+ 📊 Step 1: Running complete query first...
792
+
793
+ stdout | tests/integration/CachePoisoningPrevention.test.ts > Cache Poisoning Prevention > should cache complete queries but not use them for partial results
794
+ 📊 Step 2: Running complete query again (should be cached)...
795
+
796
+ stdout | tests/integration/CachePoisoningPrevention.test.ts > Cache Poisoning Prevention > should cache complete queries but not use them for partial results
797
+ 📊 Step 3: Running faceted query (should call API)...
798
+
799
+ stdout | tests/integration/CachePoisoningPrevention.test.ts > Cache Poisoning Prevention > should cache complete queries but not use them for partial results
800
+ ✅ Query completeness isolation working correctly!
801
+
802
+ stdout | tests/integration/CachePoisoningPrevention.test.ts > Cache Poisoning Prevention > should use different TTLs for complete vs partial queries
803
+ (1763111335655) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
804
+
805
+ stdout | tests/integration/CachePoisoningPrevention.test.ts > Cache Poisoning Prevention > should use different TTLs for complete vs partial queries
806
+ 🧪 Testing Different TTL Behavior...
807
+
808
+ stdout | tests/integration/CachePoisoningPrevention.test.ts > Cache Poisoning Prevention > should use different TTLs for complete vs partial queries
809
+ ✅ TTL configuration verified in implementation
810
+
811
+ stdout | tests/integration/CachePoisoningPrevention.test.ts > Cache Poisoning Prevention > should maintain item cache independence from query cache
812
+ (1763111335655) [INFO] - [@fjell/cache] [TwoLayerCacheMap] TwoLayerCacheMap initialized [{"underlyingType":"memory/memory","itemTTL":3600,"queryTTL":300,"facetTTL":60}]
813
+
814
+ stdout | tests/integration/CachePoisoningPrevention.test.ts > Cache Poisoning Prevention > should maintain item cache independence from query cache
815
+ 🧪 Testing Item Cache Independence...
816
+
817
+ stdout | tests/integration/CachePoisoningPrevention.test.ts > Cache Poisoning Prevention > should maintain item cache independence from query cache
818
+ ✅ Item cache independence maintained!
819
+
820
+ ✓ tests/primary/Cache.test.ts (13 tests) 12ms
821
+ ✓ tests/integration/CachePoisoningPrevention.test.ts (4 tests) 9ms
822
+ stdout | tests/cache/layers/QueryCache.test.ts > QueryCache > Cleanup Operations > should handle cleanup with debug logging enabled
823
+ [QueryCache] Cleaned up 2 expired query results
824
+
825
+ ✓ tests/cache/layers/QueryCache.test.ts (36 tests) 664ms
826
+ stderr | tests/Aggregator.test.ts > Aggregator > should throw an error if a mandatory reference is missing
827
+ (1763111335699) [ERROR] - [@fjell/cache] [ItemAggregator] Item does not have mandatory ref with key, not optional [{"key":"other","item":{"key":{"kt":"test","pk":"123e4567-e89b-12d3-a456-426614174000"},"events":{"created":{"at":{}},"updated":{"at":{}},"deleted":{"at":null}},"refs":{}}}]
828
+
829
+ stderr | tests/Aggregator.test.ts > Aggregator > should throw error for missing non-optional references
830
+ (1763111335702) [ERROR] - [@fjell/cache] [ItemAggregator] Item does not have mandatory ref with key, not optional [{"key":"other","item":{"key":{"kt":"test","pk":"123e4567-e89b-12d3-a456-426614174000"},"events":{"created":{"at":{}},"updated":{"at":{}},"deleted":{"at":null}},"refs":{}}}]
831
+
832
+ stderr | tests/Aggregator.test.ts > Aggregator > should throw error for missing references entirely
833
+ (1763111335702) [ERROR] - [@fjell/cache] [ItemAggregator] Item does not have refs an is not optional [{"item":{"key":{"kt":"test","pk":"123e4567-e89b-12d3-a456-426614174000"},"events":{"created":{"at":{}},"updated":{"at":{}},"deleted":{"at":null}}}}]
834
+
835
+ stderr | tests/Aggregator.test.ts > Aggregator > should populate an item with events that is missing events
836
+ (1763111335702) [ERROR] - [@fjell/cache] [ItemAggregator] Item does not have mandatory event with key [{"key":"created","item":{"key":{"kt":"test","pk":"123e4567-e89b-12d3-a456-426614174000"},"events":{"updated":{"at":{}},"deleted":{"at":null}}}}]
837
+
838
+ stderr | tests/Aggregator.test.ts > Aggregator > should populate an item with events when the by key is missing
839
+ (1763111335703) [ERROR] - [@fjell/cache] [ItemAggregator] populateEvent with an Event that does not have by [{"event":{"at":{}},"ik":{"kt":"test","pk":"123e4567-e89b-12d3-a456-426614174000"},"eventKey":"created"}]
840
+
841
+ stderr | tests/Aggregator.test.ts > Aggregator > should throw an error if a mandatory event is missing
842
+ (1763111335703) [ERROR] - [@fjell/cache] [ItemAggregator] Item does not have mandatory event with key [{"key":"created","item":{"key":{"kt":"test","pk":"123e4567-e89b-12d3-a456-426614174000"},"events":{},"refs":{}}}]
843
+
844
+ ✓ tests/normalization.test.ts (37 tests) 8ms
845
+ ✓ tests/Aggregator.test.ts (24 tests) 12ms
846
+ ✓ tests/utils/CacheSize.edge-cases.test.ts (30 tests) 7ms
847
+ ✓ tests/ops/allAction.test.ts (20 tests) 9ms
848
+ ✓ tests/eviction/strategies/FIFOEvictionStrategy.test.ts (26 tests) 6ms
849
+ stderr | tests/eviction/EvictionManager.test.ts > EvictionManager > error handling > should handle strategy errors gracefully
850
+ (1763111335756) [ERROR] - [@fjell/cache] [EvictionManager] Error in eviction strategy onItemAccessed [{"key":"key","error":{}}]
851
+
852
+ stderr | tests/eviction/EvictionManager.test.ts > EvictionManager > error handling > should handle strategy errors gracefully
853
+ (1763111335757) [ERROR] - [@fjell/cache] [EvictionManager] Error in eviction strategy onItemAdded [{"key":"key","error":{}}]
854
+
855
+ stderr | tests/eviction/EvictionManager.test.ts > EvictionManager > error handling > should handle strategy errors gracefully
856
+ (1763111335757) [ERROR] - [@fjell/cache] [EvictionManager] Error in eviction strategy onItemRemoved [{"key":"key","error":{}}]
857
+
858
+ stderr | tests/eviction/EvictionManager.test.ts > EvictionManager > error handling > should handle strategy errors gracefully
859
+ (1763111335757) [ERROR] - [@fjell/cache] [EvictionManager] Error in manual eviction [{"error":{}}]
860
+
861
+ ✓ tests/eviction/EvictionManager.test.ts (10 tests) 6ms
862
+ ✓ tests/warming/CacheWarmer.test.ts (20 tests) 760ms
863
+ ✓ should handle operation timeout 501ms
864
+ ✓ tests/Options.enhanced.test.ts (20 tests) 6ms
865
+ stderr | tests/ttl/TTLManager.test.ts > TTLManager > error handling and boundary conditions > should handle onItemAdded with missing metadata
866
+ (1763111335824) [WARNING] - [@fjell/cache] [TTLManager] TTL_DEBUG: No metadata found for item when setting TTL [{"key":"nonexistent-key","metadataProviderType":"MockMetadataProvider","metadataProviderMethods":["constructor","getMetadata","setMetadata","deleteMetadata","getAllMetadata","clearMetadata","getCurrentSize","getSizeLimits","setCurrentSize","setSizeLimits"]}]
867
+
868
+ ✓ tests/ttl/TTLManager.test.ts (52 tests) 7ms
869
+ ✓ tests/Options.test.ts (38 tests) 6ms
870
+ ✓ tests/ttl/TTLCalculator.test.ts (28 tests) 6ms
871
+ ✓ tests/Operations.test.ts (11 tests) 8ms
872
+ ✓ tests/integration/OptionsIntegration.test.ts (10 tests) 8ms
873
+ ✓ tests/examples/cache-configuration-example.test.ts (8 tests) 7ms
874
+ ✓ tests/utils/EvictionStrategies.test.ts (19 tests) 7ms
875
+ ✓ tests/examples/aggregator-example.integration.test.ts (1 test) 7ms
876
+ ✓ tests/Aggregator.extended.test.ts (9 tests) 6ms
877
+ ✓ tests/integration/CacheTTLEviction.integration.test.ts (11 tests) 7ms
878
+ ✓ tests/integration/query-invalidation.test.ts (4 tests) 8ms
879
+ ✓ tests/eviction/strategies/TwoQueueEvictionStrategy.test.ts (20 tests) 5ms
880
+ ✓ tests/eviction/strategies/MRUEvictionStrategy.test.ts (18 tests) 6ms
881
+ ✓ tests/Cache.string-number-keys.test.ts (4 tests) 6ms
882
+ ✓ tests/eviction/EvictionStrategyConfig.test.ts (17 tests) 4ms
883
+ ✓ tests/ops/reset.test.ts (23 tests) 5ms
884
+ ✓ tests/utils/CacheSize.test.ts (18 tests) 5ms
885
+ stderr | tests/utils/cacheInvalidation.test.ts > Cache Invalidation Utils > invalidateCachesByKeyTypes > should handle registry.get throwing error
886
+ (1763111336021) [WARNING] - [@fjell/cache] [cache],[utils],[cacheInvalidation] Failed to handle location-based invalidation [{"keyTypes":["order"],"error":"Registry error"}]
887
+ (1763111336021) [WARNING] - [@fjell/cache] [cache],[utils],[cacheInvalidation] Failed to handle location-based invalidation [{"keyTypes":["customer"],"error":"Registry error"}]
888
+
889
+ ✓ tests/utils/cacheInvalidation.test.ts (10 tests) 5ms
890
+ ✓ tests/eviction/strategies/RandomEvictionStrategy.test.ts (10 tests) 7ms
891
+ ✓ tests/CacheStats.test.ts (24 tests) 6ms
892
+ ✓ tests/examples/cache-size-and-eviction-example.test.ts (16 tests) 5ms
893
+ ✓ tests/ops/facet.test.ts (5 tests) 4ms
894
+ ✓ tests/Instance.integration.test.ts (11 tests) 5ms
895
+ ✓ tests/Instance.test.ts (13 tests) 4ms
896
+ ✓ tests/CacheInfo.test.ts (4 tests) 4ms
897
+ ✓ tests/Registry.test.ts (7 tests) 3ms
898
+ ✓ tests/Cache.integration.test.ts (6 tests) 4ms
899
+ ✓ tests/Cache.test.ts (3 tests) 3ms
900
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Statistics and Monitoring > should cleanup and log when debug enabled
901
+ [ItemCache] Stored item: debug-key (expires: 2025-11-14T09:08:56.578Z)
902
+
903
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Debug Logging > should log operations when debug enabled
904
+ [ItemCache] Stored item: debug-key (expires: 2025-11-14T10:08:56.531Z)
905
+
906
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Debug Logging > should log operations when debug enabled
907
+ [ItemCache] Cache hit for key: debug-key
908
+
909
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Debug Logging > should log operations when debug enabled
910
+ [ItemCache] Cache hit for key: debug-key
911
+
912
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Debug Logging > should log operations when debug enabled
913
+ [ItemCache] Deleted item: debug-key (existed: true)
914
+
915
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Debug Logging > should log operations when debug enabled
916
+ [ItemCache] Cleared 0 items
917
+
918
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Statistics Accuracy > should accurately count mixed valid and expired items
919
+ [ItemCache] Cleaned up 1 expired items
920
+
921
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Debug Mode Behaviors > should provide detailed logging in debug mode
922
+ [ItemCache] Stored item: debug-operations-key (expires: 2025-11-14T10:08:56.742Z)
923
+
924
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Debug Mode Behaviors > should provide detailed logging in debug mode
925
+ [ItemCache] Cache hit for key: debug-operations-key
926
+
927
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Debug Mode Behaviors > should provide detailed logging in debug mode
928
+ [ItemCache] Deleted item: debug-operations-key (existed: true)
929
+
930
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Debug Mode Behaviors > should provide detailed logging in debug mode
931
+ [ItemCache] Cleared 0 items
932
+
933
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Debug Mode Behaviors > should handle expired item logging in debug mode
934
+ [ItemCache] Stored item: expiring-debug-key (expires: 2025-11-14T09:08:56.792Z)
935
+
936
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Debug Mode Behaviors > should handle expired item logging in debug mode
937
+ [ItemCache] Expired item removed: expiring-debug-key
938
+
939
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Debug Mode Behaviors > should handle cleanup logging in debug mode
940
+ [ItemCache] Stored item: cleanup-debug-1 (expires: 2025-11-14T09:08:56.894Z)
941
+
942
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Debug Mode Behaviors > should handle cleanup logging in debug mode
943
+ [ItemCache] Stored item: cleanup-debug-2 (expires: 2025-11-14T09:08:56.894Z)
944
+
945
+ stdout | tests/cache/layers/ItemCache.test.ts > ItemCache > Debug Mode Behaviors > should handle cleanup logging in debug mode
946
+ [ItemCache] Cleaned up 2 expired items
947
+
948
+ ✓ tests/cache/layers/ItemCache.test.ts (37 tests) 1929ms
949
+ ✓ should use custom TTL when provided 1101ms
950
+ ✓ tests/integration/TTLPersistence.integration.test.ts (3 tests) 2613ms
951
+ ✓ should persist TTL metadata and validate expiration across cache lifecycle 2507ms
952
+ ✓ tests/examples/cache-stats-example.test.ts (9 tests) 9845ms
953
+ ✓ should calculate hit ratio correctly 4868ms
954
+ ✓ should handle cache operations that result in errors gracefully 4966ms
955
+
956
+ ⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯
957
+ Error: ENOENT: no such file or directory, open '/Users/tobrien/gitw/getfjell/cache/coverage/.tmp/coverage-73.json'
958
+ ❯ open node:internal/fs/promises:642:25
959
+ ❯ Object.writeFile node:internal/fs/promises:1249:14
960
+
961
+ ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
962
+ Serialized Error: { errno: -2, code: 'ENOENT', syscall: 'open', path: '/Users/tobrien/gitw/getfjell/cache/coverage/.tmp/coverage-73.json' }
963
+
964
+
965
+