From 623b4fde61fa63a733ce3c0a2abf2d2163013747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Garc=C3=ADa?= Date: Tue, 12 Nov 2024 19:55:51 -0600 Subject: [PATCH] Fix screenshot buffer issue --- test/visual-regression.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/visual-regression.js b/test/visual-regression.js index 22c1a36..3f31f1a 100644 --- a/test/visual-regression.js +++ b/test/visual-regression.js @@ -68,7 +68,8 @@ async function resetDirectory(path) { */ async function createOrCompareScreenshotFactory(page, filename) { async function getScreenshotBuffer() { - const buffer = await page.screenshot({ encoding: 'binary' }); + const screenshot = await page.screenshot({ encoding: 'binary' }); + const buffer = Buffer.from(screenshot); if (!Buffer.isBuffer(buffer)) { throw new Error('Screenshot is not a Buffer'); }