(args: string[])
| 19 | } |
| 20 | |
| 21 | export async function runCli(args: string[]): Promise<CliResult> { |
| 22 | const child = forkCli(args); |
| 23 | |
| 24 | let output = ""; |
| 25 | child.stdout!.on("data", (data: Buffer) => (output += data.toString())); |
| 26 | child.stderr!.on("data", (data: Buffer) => (output += data.toString())); |
| 27 | |
| 28 | return new Promise(resolve => { |
| 29 | child.on("close", exitCode => resolve({ exitCode: exitCode ?? 1, output })); |
| 30 | }); |
| 31 | } |
no test coverage detected