test: update remote-control tests for stdin pipe change

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Gabi Simons
2026-03-16 09:41:09 +00:00
parent d49af91cc2
commit 924482870e

View File

@@ -24,7 +24,12 @@ import {
// --- Helpers ---
function createMockProcess(pid = 12345) {
return { pid, unref: vi.fn(), kill: vi.fn() };
return {
pid,
unref: vi.fn(),
kill: vi.fn(),
stdin: { write: vi.fn(), end: vi.fn() },
};
}
describe('remote-control', () => {
@@ -101,8 +106,8 @@ describe('remote-control', () => {
const spawnCall = spawnMock.mock.calls[0];
const options = spawnCall[2];
// stdio should use file descriptors (numbers), not 'pipe'
expect(options.stdio[0]).toBe('ignore');
// stdio[0] is 'pipe' so we can write 'y' to accept the prompt
expect(options.stdio[0]).toBe('pipe');
expect(typeof options.stdio[1]).toBe('number');
expect(typeof options.stdio[2]).toBe('number');
});