Skip to content

Commit

Permalink
Fix screenshot buffer issue
Browse files Browse the repository at this point in the history
  • Loading branch information
twin-tigon committed Nov 13, 2024
1 parent 961193d commit 623b4fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/visual-regression.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit 623b4fd

Please sign in to comment.