(t, useShortcutProperty, objectMode, addNoopTransform, type, input)
| 66 | |
| 67 | // eslint-disable-next-line max-params |
| 68 | const testGeneratorInputPipe = async (t, useShortcutProperty, objectMode, addNoopTransform, type, input) => { |
| 69 | const {generators, output} = getInputObjectMode(objectMode, addNoopTransform, type); |
| 70 | const subprocess = execa('stdin-fd.js', ['0'], getStdio(0, generators)); |
| 71 | const stream = useShortcutProperty ? subprocess.stdin : subprocess.stdio[0]; |
| 72 | stream.end(...input); |
| 73 | const {stdout} = await subprocess; |
| 74 | const expectedOutput = input[1] === 'utf16le' ? Buffer.from(output, input[1]).toString() : output; |
| 75 | t.is(stdout, expectedOutput); |
| 76 | }; |
| 77 | |
| 78 | test('Can use generators with subprocess.stdio[0] and default encoding', testGeneratorInputPipe, false, false, false, 'generator', [foobarString, 'utf8']); |
| 79 | test('Can use generators with subprocess.stdin and default encoding', testGeneratorInputPipe, true, false, false, 'generator', [foobarString, 'utf8']); |
nothing calls this directly
no test coverage detected