Run the built CLI; output with colour codes removed.
(args: string[], nodeFlags: string[] = [])
| 204 | |
| 205 | /** Run the built CLI; output with colour codes removed. */ |
| 206 | function cli(args: string[], nodeFlags: string[] = []): { status: number | null; output: string } { |
| 207 | const r = spawnSync(process.execPath, [...nodeFlags, '--liftoff-only', '--disable-warning=ExperimentalWarning', BIN, ...args], { |
| 208 | encoding: 'utf8', |
| 209 | env: { ...process.env, CODEGRAPH_NO_DAEMON: '1', CODEGRAPH_TELEMETRY: '0', DO_NOT_TRACK: '1', CODEGRAPH_NO_UPDATE_CHECK: '1', NO_COLOR: '1' }, |
| 210 | timeout: 120_000, |
| 211 | }); |
| 212 | return { status: r.status, output: `${r.stdout}${r.stderr}`.replace(/\x1b\[[0-9;]*m/g, '') }; |
| 213 | } |
| 214 | |
| 215 | describe('the CLI', () => { |
| 216 | it.runIf(process.platform === 'win32')('names the SQLite failure in status, sync and query', async () => { |
no outgoing calls
no test coverage detected