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)