You've already forked tf2wikipricing
fix: mock data not using correct date format
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user