(cwd: string, extraArgs: string[])
| 20 | const BIN = path.resolve(__dirname, '../dist/bin/codegraph.js'); |
| 21 | |
| 22 | function runNode(cwd: string, extraArgs: string[]): { stdout: string; stderr: string; code: number } { |
| 23 | try { |
| 24 | const stdout = execFileSync(process.execPath, [BIN, 'node', ...extraArgs, '-p', cwd], { |
| 25 | encoding: 'utf-8', |
| 26 | env: { ...process.env, CODEGRAPH_NO_DAEMON: '1', CODEGRAPH_WASM_RELAUNCHED: '1' }, |
| 27 | stdio: ['ignore', 'pipe', 'pipe'], |
| 28 | }); |
| 29 | return { stdout, stderr: '', code: 0 }; |
| 30 | } catch (err: any) { |
| 31 | return { stdout: err.stdout ?? '', stderr: err.stderr ?? '', code: err.status ?? 1 }; |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | describe('codegraph node — argument handling (#1044)', () => { |
| 36 | let tempDir: string; |
no outgoing calls
no test coverage detected