Skip to content

Commit b98d015

Browse files
committed
fix: allow async callbacks in waitFor (use type from wait-for-expect)
1 parent de3c814 commit b98d015

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,10 @@ export async function getDocument(_page?: Page): Promise<ElementHandle> {
155155
return document
156156
}
157157

158+
type WaitForCallback = Parameters<typeof waitForExpect>[0]
159+
158160
export function wait(
159-
callback: () => void,
161+
callback: WaitForCallback,
160162
{timeout = 4500, interval = 50}: {timeout?: number; interval?: number} = {},
161163
): Promise<{}> {
162164
return waitForExpect(callback, timeout, interval)

0 commit comments

Comments
 (0)