(child)
| 27 | const exec = require('child_process').exec; |
| 28 | |
| 29 | function test(child) { |
| 30 | exec(...common.escapePOSIXShell`(echo "${data1}"; sleep 0.5; echo "${data2}") | "${process.execPath}" "${__filename}" "${child}"`, |
| 31 | common.mustSucceed((stdout, stderr) => { |
| 32 | assert.strictEqual( |
| 33 | stdout, |
| 34 | expected, |
| 35 | `expected to read(${child === childType[0] ? 'with' : 'without'} encoding): '${expected}' but got: '${stdout}'`); |
| 36 | assert.strictEqual( |
| 37 | stderr, |
| 38 | '', |
| 39 | `expected not to read anything from stderr but got: '${stderr}'`); |
| 40 | })); |
| 41 | } |
| 42 | |
| 43 | test(childType[0]); |
| 44 | test(childType[1]); |
no test coverage detected
searching dependent graphs…