(args: string[])
| 21 | |
| 22 | // Utility to run tmux commands |
| 23 | function tmux(args: string[]): Promise<string> { |
| 24 | return new Promise((resolve, reject) => { |
| 25 | const proc = spawn('tmux', args, { stdio: 'pipe' }) |
| 26 | let stdout = '' |
| 27 | let stderr = '' |
| 28 | |
| 29 | proc.stdout?.on('data', (data) => { |
| 30 | stdout += data.toString() |
| 31 | }) |
| 32 | |
| 33 | proc.stderr?.on('data', (data) => { |
| 34 | stderr += data.toString() |
| 35 | }) |
| 36 | |
| 37 | proc.on('close', (code) => { |
| 38 | if (code === 0) { |
| 39 | resolve(stdout) |
| 40 | } else { |
| 41 | reject(new Error(`tmux command failed: ${stderr}`)) |
| 42 | } |
| 43 | }) |
| 44 | }) |
| 45 | } |
| 46 | |
| 47 | describe.skipIf(!tmuxAvailable || !sdkBuilt)( |
| 48 | 'CLI Integration Tests with tmux', |
no test coverage detected