()
| 44 | }); |
| 45 | |
| 46 | function 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 | } |
no test coverage detected