test: update remote-control tests for stdin pipe change
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,7 +24,12 @@ import {
|
|||||||
// --- Helpers ---
|
// --- Helpers ---
|
||||||
|
|
||||||
function createMockProcess(pid = 12345) {
|
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', () => {
|
describe('remote-control', () => {
|
||||||
@@ -101,8 +106,8 @@ describe('remote-control', () => {
|
|||||||
|
|
||||||
const spawnCall = spawnMock.mock.calls[0];
|
const spawnCall = spawnMock.mock.calls[0];
|
||||||
const options = spawnCall[2];
|
const options = spawnCall[2];
|
||||||
// stdio should use file descriptors (numbers), not 'pipe'
|
// stdio[0] is 'pipe' so we can write 'y' to accept the prompt
|
||||||
expect(options.stdio[0]).toBe('ignore');
|
expect(options.stdio[0]).toBe('pipe');
|
||||||
expect(typeof options.stdio[1]).toBe('number');
|
expect(typeof options.stdio[1]).toBe('number');
|
||||||
expect(typeof options.stdio[2]).toBe('number');
|
expect(typeof options.stdio[2]).toBe('number');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user