From 924482870e5b996a02ed46576b6d243c349a85d0 Mon Sep 17 00:00:00 2001 From: Gabi Simons Date: Mon, 16 Mar 2026 09:41:09 +0000 Subject: [PATCH] test: update remote-control tests for stdin pipe change Co-Authored-By: Claude Opus 4.6 --- src/remote-control.test.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/remote-control.test.ts b/src/remote-control.test.ts index 4b5ab2f..354069e 100644 --- a/src/remote-control.test.ts +++ b/src/remote-control.test.ts @@ -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'); });