| 20 | ).version as string; |
| 21 | |
| 22 | function runStatusJson(cwd: string): Record<string, unknown> { |
| 23 | const stdout = execFileSync(process.execPath, [BIN, 'status', '--json'], { |
| 24 | cwd, |
| 25 | encoding: 'utf-8', |
| 26 | env: { ...process.env, CODEGRAPH_NO_DAEMON: '1' }, |
| 27 | stdio: ['ignore', 'pipe', 'pipe'], |
| 28 | }); |
| 29 | // JSON mode prints exactly one line to stdout; be defensive about any stray |
| 30 | // leading output by parsing the last non-empty line. |
| 31 | const line = stdout.trim().split('\n').filter(Boolean).pop()!; |
| 32 | return JSON.parse(line); |
| 33 | } |
| 34 | |
| 35 | describe('codegraph status --json — CI fields (#329)', () => { |
| 36 | let tempDir: string; |