(stdoutData: string)
| 13 | import { IProcess, IProcessTree, processTree } from '../../ui/processTree/processTree'; |
| 14 | |
| 15 | const fakeChildProcess = (stdoutData: string) => { |
| 16 | const ee: any = new EventEmitter(); |
| 17 | ee.stderr = new ReadableStreamBuffer(); |
| 18 | ee.stderr.stop(); |
| 19 | ee.stdout = new ReadableStreamBuffer({ frequency: 2, chunkSize: 32 }); |
| 20 | ee.stdout.put(stdoutData); |
| 21 | ee.stdout.stop(); |
| 22 | ee.stdout.once('end', () => setTimeout(() => ee.emit('close', 0), 1)); |
| 23 | |
| 24 | return ee; |
| 25 | }; |
| 26 | |
| 27 | const assertParses = async (tree: IProcessTree, input: string, expected: IProcess[]) => { |
| 28 | const stubbed = stub(tree, 'createProcess' as any).returns(fakeChildProcess(input)); |
no test coverage detected