Skip to content

Commit a22426a

Browse files
committed
Fix cachified mock context
1 parent 185c2a1 commit a22426a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/mocks/cache-server.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,10 @@ export async function searchCacheKeys(search: string, limit: number) {
4949

5050
export async function cachified<Value>(
5151
options: {
52-
getFreshValue: () => Promise<Value> | Value
52+
getFreshValue: (context: { metadata: CacheEntry<unknown>['metadata'] }) => Promise<Value> | Value
5353
},
5454
): Promise<Value> {
55-
return options.getFreshValue()
55+
return options.getFreshValue({
56+
metadata: { createdTime: Date.now(), ttl: null, swr: null },
57+
})
5658
}

0 commit comments

Comments
 (0)