* Lazily import playwright. Throws a clear error if not installed.
()
| 73 | * Lazily import playwright. Throws a clear error if not installed. |
| 74 | */ |
| 75 | async function importPlaywright(): Promise<typeof import('playwright')> { |
| 76 | try { |
| 77 | // @ts-ignore — optional dep, may not be installed |
| 78 | return await import('playwright'); |
| 79 | } catch (e: any) { |
| 80 | throw new Error( |
| 81 | 'playwright is not installed. Run:\n' + |
| 82 | ' npm install playwright\n' + |
| 83 | ' npx playwright install chromium\n' + |
| 84 | '(playwright is an optional dependency to keep base install small)', |
| 85 | ); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Get the active session, launching the browser if needed. |
no outgoing calls
no test coverage detected