Skip to content

Commit af3c3ae

Browse files
committed
fix: Include the sleep function that we are calling
1 parent f8f5f06 commit af3c3ae

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

.github/actions/find/src/findForUrl.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,8 @@ export async function findForUrl(url: string, sessionStatePath?: string): Promis
1010
const page = await context.newPage();
1111
await page.goto(url);
1212

13-
try {
14-
console.log("Sleeping for 5 seconds to allow page to load completely...");
15-
await sleep(5000);
16-
console.log(page.url());
17-
} catch (error) {
18-
console.error('Error occurred while sleeping or logging URL:', error);
19-
}
20-
console.log("Continuing with accessibility scan...");
13+
await sleep(5000);
14+
console.log(page.url());
2115

2216
let findings: Finding[] = [];
2317
try {

.github/actions/find/src/sleep.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/**
2+
* Sleep for a given number of milliseconds.
3+
* @param ms Time to sleep, in milliseconds.
4+
* @returns
5+
*/
6+
export async function sleep(ms: number): Promise<void> {
7+
return new Promise((resolve) => setTimeout(() => resolve(), ms))
8+
}

0 commit comments

Comments
 (0)