Skip to content

Commit

Permalink
[tests] Work around Puppeteer 23.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgpearce committed Sep 23, 2024
1 parent 79b0062 commit 248bb46
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/e2e/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import replace from 'buffer-replace';

jest.setTimeout(10000);

let browserWarmed = false;

export const getServerFunctions = (
port: number,
): [() => void, () => void, (path: string) => Promise<void>] => {
Expand Down Expand Up @@ -36,6 +38,11 @@ export const getServerFunctions = (
};

const expectPage = async (path: string): Promise<void> => {
if (!browserWarmed) {
await new Promise((resolve) => setTimeout(resolve, 1000));
// ^ needed since Puppeteer 23.4.0
browserWarmed = true;
}
await page.goto(`${DOMAIN}${path}`);
};

Expand Down

0 comments on commit 248bb46

Please sign in to comment.