fix: preserve ebay rate-limit fallback

This commit is contained in:
old4ever committed 2026-04-29 14:52:08 -04:00
1 parent 82e7abc057
commit 5d86a4e54d
2 files changed
+18 -3

No files matched your search

+15
View File
@@ -86,6 +86,21 @@ describe("eBay Scraper Cookie Handling", () => {
]);
});
test("returns empty results when eBay rate-limits the request", async () => {
global.fetch = mock(() =>
Promise.resolve({
ok: false,
status: 429,
headers: { get: () => "0" },
text: () => Promise.resolve(""),
}),
) as unknown as typeof fetch;
const results = await fetchEbayItems("laptop", 1000);
expect(results).toEqual([]);
});
test("deduplicates repeated item links from the same card", async () => {
global.fetch = mock(() =>
Promise.resolve({