From 492aa4e9818cb7f7108015ab39c3e035ad9162d5 Mon Sep 17 00:00:00 2001 From: vegancat Date: Tue, 26 Aug 2025 15:03:25 +0300 Subject: [PATCH] feat(matchScreenshot): sync from pw-utils --- actions/matchScreenshot.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/actions/matchScreenshot.ts b/actions/matchScreenshot.ts index fbc5927..53f8c19 100644 --- a/actions/matchScreenshot.ts +++ b/actions/matchScreenshot.ts @@ -9,8 +9,6 @@ export type Theme = 'light' | 'dark'; export type OnSwitchThemeCallback = (theme: Theme, page: Page) => Promise; -export type OnBeforeScreenshotCallback = (page: Page) => Promise; - export type ScreenshotOptions = Omit & { /** * An acceptable ratio of pixels that are different to the total amount of pixels, between `0` and `1`. Default is @@ -32,6 +30,8 @@ export type ScreenshotOptions = Omit Promise; + export type MatchScreenshotOptions = { /** * The element or page to be screenshotted @@ -158,7 +158,7 @@ export async function matchScreenshot( await page.mouse.move(x, y); } - await onBeforeScreenshot?.(page); + await onBeforeScreenshot?.(page, combinedOptions); const slug = getTestSlug(page);