( queryKey: readonly unknown[], error: Error, errorUpdatedAt?: number, )
| 585 | * This simulates what happens when a fetch fails with no prior successful data. |
| 586 | */ |
| 587 | export function setErrorOnlyCacheEntry( |
| 588 | queryKey: readonly unknown[], |
| 589 | error: Error, |
| 590 | errorUpdatedAt?: number, |
| 591 | ): void { |
| 592 | const key = serializeQueryKey(queryKey) |
| 593 | setCacheEntry(key, { |
| 594 | data: undefined, |
| 595 | dataUpdatedAt: 0, |
| 596 | error, |
| 597 | errorUpdatedAt: errorUpdatedAt ?? Date.now(), |
| 598 | }) |
| 599 | } |
| 600 | |
| 601 | /** |
| 602 | * Test helpers for verifying retry behavior. |
no test coverage detected