docs: align cookie setup with env-only auth

This commit is contained in:
2026-04-21 21:53:42 -04:00
parent d65d81dbd1
commit b6e9501448
6 changed files with 716 additions and 100 deletions

View File

@@ -11,9 +11,13 @@ mock.module("@marketplace-scrapers/core", () => ({
describe("API routes", () => {
beforeEach(() => {
fetchFacebookItems.mockReset();
fetchFacebookItems.mockImplementation(() => Promise.resolve([{ title: "item" }]));
fetchFacebookItems.mockImplementation(() =>
Promise.resolve([{ title: "item" }]),
);
fetchEbayItems.mockReset();
fetchEbayItems.mockImplementation(() => Promise.resolve([{ title: "item" }]));
fetchEbayItems.mockImplementation(() =>
Promise.resolve([{ title: "item" }]),
);
});
afterEach(() => {
@@ -37,7 +41,9 @@ describe("API routes", () => {
const { ebayRoute } = await import("../src/routes/ebay");
await ebayRoute(
new Request("http://localhost/api/ebay?q=laptop&cookies=s%3D1&buyItNowOnly=true"),
new Request(
"http://localhost/api/ebay?q=laptop&cookies=s%3D1&buyItNowOnly=true",
),
);
expect(fetchEbayItems).toHaveBeenCalledWith("laptop", 1, {