fix(scrapeURL/fire-engine): screenshot broken hotfix

This commit is contained in:
Gergő Móricz 2025-02-17 18:59:16 +01:00
parent b0534d0767
commit 5c4021e8cf
2 changed files with 3 additions and 3 deletions

View File

@ -98,7 +98,7 @@ describe("Scrape tests", () => {
}); });
expectScrapeToSucceed(response); expectScrapeToSucceed(response);
expect(response.body.data.screenshot).toBeTruthy(); expect(typeof response.body.data.screenshot).toBe("string");
}, 15000); }, 15000);
it.concurrent("screenshot@fullPage format works", async () => { it.concurrent("screenshot@fullPage format works", async () => {
@ -108,7 +108,7 @@ describe("Scrape tests", () => {
}); });
expectScrapeToSucceed(response); expectScrapeToSucceed(response);
expect(response.body.data.screenshot).toBeTruthy(); expect(typeof response.body.data.screenshot).toBe("string");
}, 15000); }, 15000);
}) })
}); });

View File

@ -229,7 +229,7 @@ export async function scrapeURLWithFireEngineChromeCDP(
{ screenshots: response.screenshots }, { screenshots: response.screenshots },
); );
if (response.screenshots) { if (response.screenshots) {
response.screenshot = response.screenshots.slice(-1, 0)[0]; response.screenshot = response.screenshots.slice(-1)[0];
response.screenshots = response.screenshots.slice(0, -1); response.screenshots = response.screenshots.slice(0, -1);
} }
meta.logger.debug("Screenshot transformation done", { meta.logger.debug("Screenshot transformation done", {