diff --git a/fluxer_api/pkgs/cache/src/__tests__/CacheGetOrSet.test.ts b/fluxer_api/pkgs/cache/src/__tests__/CacheGetOrSet.test.ts index bbc3f555e..cc6ff1eff 100644 --- a/fluxer_api/pkgs/cache/src/__tests__/CacheGetOrSet.test.ts +++ b/fluxer_api/pkgs/cache/src/__tests__/CacheGetOrSet.test.ts @@ -62,7 +62,9 @@ describe('ICacheService.getOrSet', () => { expect(factory).toHaveBeenCalledTimes(1); }); - it('resolves the ttl from the produced value', async () => { + it('resolves the ttl from the produced value', async ({onTestFinished}) => { + const now = vi.spyOn(Date, 'now').mockReturnValue(1_000); + onTestFinished(() => now.mockRestore()); const client = new MockKVProvider(); const provider = new KVCacheProvider({client}); const resolver = (value: number | null) => (value === null ? 5 : 30);