(
dir: string,
fn: (address: string, dir: string) => void | Promise<void>,
env: Record<string, string> = {},
)
| 74 | } |
| 75 | |
| 76 | export async function launchDevServer( |
| 77 | dir: string, |
| 78 | fn: (address: string, dir: string) => void | Promise<void>, |
| 79 | env: Record<string, string> = {}, |
| 80 | ) { |
| 81 | await withChildProcessServer( |
| 82 | { |
| 83 | cwd: dir, |
| 84 | args: ["run", "-A", "--cached-only", "npm:vite", "--port", "0"], |
| 85 | env, |
| 86 | }, |
| 87 | async (address) => await fn(address, dir), |
| 88 | ); |
| 89 | } |
| 90 | |
| 91 | export async function spawnDevServer( |
| 92 | dir: string, |
no test coverage detected