From 39ad61b7686850e8e553572f849e0f568f6c0c46 Mon Sep 17 00:00:00 2001 From: xenticore Date: Wed, 30 Apr 2025 18:32:02 -0400 Subject: [PATCH] fix: mock data not using correct date format --- __tests__/priceService.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/priceService.test.ts b/__tests__/priceService.test.ts index b66c64d..ad54796 100644 --- a/__tests__/priceService.test.ts +++ b/__tests__/priceService.test.ts @@ -35,7 +35,7 @@ describe('Price Service', () => { const mockCachedData: ItemPriceData = { sku: mockSku, - update: new Date(Date.now() - 15 * 60 * 1000), // 15 minutes ago + update: new Date(Date.now() - 15 * 60 * 1000).getTime(), // 15 minutes ago ttl: mockTtl, keys: 1, metal: 21.11, @@ -56,7 +56,7 @@ describe('Price Service', () => { }) test('fetchPrice fetches new data when cache is expired', async () => { - const expiredCache: ItemPriceData = { ...mockCachedData, update: new Date(Date.now() - 2 * mockTtl) }; + const expiredCache: ItemPriceData = { ...mockCachedData, update: new Date(Date.now() - 2 * mockTtl).getTime() }; (getStorageValue as jest.Mock).mockResolvedValue(expiredCache); (priceUsingPricesTF as jest.Mock).mockResolvedValue(mockPriceResponse)