Skip to content

Commit

Permalink
use snap in puppeteer script
Browse files Browse the repository at this point in the history
  • Loading branch information
narthur committed Mar 20, 2024
1 parent 7165f9c commit ae97070
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/puppeteer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ async function handleUrl(browser: Browser, url: string) {
const pathname = new URL(url).pathname;
console.time(pathname);

const path1 = await snap(browser, url, "base");
const path2 = await snap(browser, url.replace(base, compare), "compare");
const path1 = await snap(browser, `${url}?snap`, "base");
const path2 = await snap(
browser,
`${url.replace(base, compare)}?snap`,
"compare",
);
const img1 = readScreenshot(path1);
const img2 = readScreenshot(path2);
const meta1 = await img1.metadata();
Expand Down

0 comments on commit ae97070

Please sign in to comment.