(stdout: string, stderr = '', exitCode = 0)
| 30 | const workspace: WorkspaceConfig = { workspaceDir: '/workspace', additionalDirs: ['/extra'] }; |
| 31 | |
| 32 | function processWithOutput(stdout: string, stderr = '', exitCode = 0): KaosProcess { |
| 33 | const stdoutStream = Readable.from([stdout]); |
| 34 | const stderrStream = Readable.from([stderr]); |
| 35 | return { |
| 36 | stdin: { end: vi.fn(), write: vi.fn() } as unknown as Writable, |
| 37 | stdout: stdoutStream, |
| 38 | stderr: stderrStream, |
| 39 | pid: 123, |
| 40 | exitCode, |
| 41 | wait: vi.fn().mockResolvedValue(exitCode), |
| 42 | kill: vi.fn(async () => {}), |
| 43 | dispose: vi.fn(async () => { |
| 44 | stdoutStream.destroy(); |
| 45 | stderrStream.destroy(); |
| 46 | }), |
| 47 | }; |
| 48 | } |
| 49 | |
| 50 | function dirStat(): StatResult { |
| 51 | return { |
no test coverage detected