(t, methodName, hasWrites)
| 90 | }); |
| 91 | |
| 92 | const testEarlySuccess = async (t, methodName, hasWrites) => { |
| 93 | const subprocess = hasWrites ? getReadableSubprocess() : execa('empty.js'); |
| 94 | const stream = subprocess[methodName](); |
| 95 | |
| 96 | const error = await t.throwsAsync(finishedStream(stream)); |
| 97 | t.like(error, prematureClose); |
| 98 | assertWritableAborted(t, subprocess.stdin); |
| 99 | t.true(subprocess.stdout.readableEnded); |
| 100 | t.true(subprocess.stderr.readableEnded); |
| 101 | await assertSubprocessOutput(t, subprocess, hasWrites ? foobarString : ''); |
| 102 | }; |
| 103 | |
| 104 | test('subprocess early success with no writes -> .writable() abort', testEarlySuccess, 'writable', false); |
| 105 | test('subprocess early success with no writes -> .duplex() abort', testEarlySuccess, 'duplex', false); |
nothing calls this directly
no test coverage detected
searching dependent graphs…