* Integration tests for invokeEngineAsync using /bin/sh as a fake engine * binary. These pin the four behaviors that actually bit us during Phase 1 * end-to-end validation: stdout capture, stderr surfacing on non-zero exit, * stdin-closed so cat-like children don't hang, and fast-kill on timeout.
(name: string, script: string)
| 12 | */ |
| 13 | |
| 14 | function shEngine(name: string, script: string): ResolvedEngine { |
| 15 | return { |
| 16 | name, |
| 17 | label: name, |
| 18 | config: { |
| 19 | bin: '/bin/sh', |
| 20 | // Ignore the prompt — fake engines don't consume it. |
| 21 | args: () => ['-c', script], |
| 22 | }, |
| 23 | }; |
| 24 | } |
| 25 | |
| 26 | test('invokeEngineAsync: returns trimmed stdout on zero exit', async () => { |
| 27 | const { invokeEngineAsync } = await import('../src/engine.js'); |