MCPcopy Index your code
hub / github.com/callstack/agent-device / makeMockChild

Function makeMockChild

src/utils/__tests__/exec-windows-hide.test.ts:46–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44});
45
46function makeMockChild(): ReturnType<typeof import('node:child_process').spawn> {
47 const child = new EventEmitter() as MockChildProcess;
48 child.stdin = new PassThrough();
49 child.stdout = new PassThrough();
50 child.stderr = new PassThrough();
51 child.kill = vi.fn(() => true);
52 child.unref = vi.fn();
53
54 queueMicrotask(() => {
55 child.stdout?.end();
56 child.stderr?.end();
57 child.emit('close', 0, null);
58 });
59
60 return child as unknown as ReturnType<typeof import('node:child_process').spawn>;
61}

Callers 1

Calls 1

emitMethod · 0.80

Tested by

no test coverage detected