| 287 | callback?: UntilBrowserLogAfterCallback, |
| 288 | ): Promise<string[]> |
| 289 | export async function untilBrowserLogAfter( |
| 290 | operation: () => any, |
| 291 | target: string | RegExp | Array<string | RegExp>, |
| 292 | arg3?: boolean | UntilBrowserLogAfterCallback, |
| 293 | arg4?: UntilBrowserLogAfterCallback, |
| 294 | ): Promise<string[]> { |
| 295 | const expectOrder = typeof arg3 === 'boolean' ? arg3 : false |
| 296 | const callback = typeof arg3 === 'boolean' ? arg4 : arg3 |
| 297 | |
| 298 | const promise = untilBrowserLog(target, expectOrder) |
| 299 | await operation() |
| 300 | const logs = await promise |
| 301 | if (callback) { |
| 302 | await callback(logs) |
| 303 | } |
| 304 | return logs |
| 305 | } |
| 306 | |
| 307 | async function untilBrowserLog( |
| 308 | target?: string | RegExp | Array<string | RegExp>, |