Run the CLI with stdin closed — a prompt that blocks would hang / fail here.
(args: string[], cwd: string)
| 26 | |
| 27 | /** Run the CLI with stdin closed — a prompt that blocks would hang / fail here. */ |
| 28 | function runCodegraph(args: string[], cwd: string): RunResult { |
| 29 | try { |
| 30 | const stdout = execFileSync(process.execPath, [BIN, ...args], { |
| 31 | cwd, |
| 32 | encoding: 'utf-8', |
| 33 | env: { |
| 34 | ...process.env, |
| 35 | CODEGRAPH_NO_DAEMON: '1', |
| 36 | CODEGRAPH_TELEMETRY: '0', |
| 37 | DO_NOT_TRACK: '1', |
| 38 | NO_COLOR: '1', |
| 39 | }, |
| 40 | stdio: ['ignore', 'pipe', 'pipe'], |
| 41 | timeout: 120_000, |
| 42 | }); |
| 43 | return { status: 0, stdout, stderr: '' }; |
| 44 | } catch (err) { |
| 45 | const e = err as { status?: number | null; stdout?: string | Buffer; stderr?: string | Buffer }; |
| 46 | return { |
| 47 | status: e.status ?? -1, |
| 48 | stdout: String(e.stdout ?? ''), |
| 49 | stderr: String(e.stderr ?? ''), |
| 50 | }; |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | describe('codegraph install --init / init --yes (#1578)', () => { |
| 55 | let tempDir: string; |
no outgoing calls
no test coverage detected