Improve default value of transforms `objectMode` (#867)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by ehmicky · committed by GitHub · parent 08f8e5d · Browse files · 5 files·+158 added−84 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+158 added−84 removed
- tests:+151 added−78 removed
- other:+7 added−6 removed
Provenance
- Commit
8f51c6b- Tree
364432e- Author
ehmicky <ehmicky@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
08f8e5d
5 files changed+158 added−84 removed
modified:lib/stdio/encoding-final.js+3 added-2 removed
8 unmodified lines9101112131314151617186 unmodified lines2526272828293031323323 unmodified lines8 unmodified lines if (!shouldEncodeOutput(newStdioStreams, encoding, isSync)) { return newStdioStreams; }
const objectMode = newStdioStreams.findLast(({type}) => type === 'generator')?.value.objectMode === true; const lastObjectStdioStream = newStdioStreams.findLast(({type, value}) => type === 'generator' && value.objectMode !== undefined); const objectMode = lastObjectStdioStream !== undefined && lastObjectStdioStream.value.objectMode; const stringDecoder = new StringDecoder(encoding); const generator = objectMode ? { transform: encodingObjectGenerator.bind(undefined, stringDecoder),6 unmodified lines ...newStdioStreams, { ...newStdioStreams[0], type: 'generator', value: {...generator, binary: true, objectMode}, value: {...generator, binary: true}, encoding: 'buffer', }, ];};23 unmodified linesmodified:lib/stdio/generator.js+4 added-4 removed
17 unmodified lines181920212222232425269 unmodified lines363738394040414243444546464748484950515251 unmodified lines17 unmodified lines return [...nonGenerators, ...sortGenerators(newGenerators)];};
const normalizeGenerator = ({value, ...stdioStream}, index, newGenerators) => { const {transform, final, binary = false, objectMode = false} = isGeneratorOptions(value) ? value : {transform: value}; const {transform, final, binary = false, objectMode} = isGeneratorOptions(value) ? value : {transform: value}; const objectModes = stdioStream.direction === 'output' ? getOutputObjectModes(objectMode, index, newGenerators) : getInputObjectModes(objectMode, index, newGenerators); return {...stdioStream, value: {transform, final, binary, ...objectModes}};9 unmodified linesThe same applies to the first output's generator's `writableObjectMode`.*/const getOutputObjectModes = (objectMode, index, newGenerators) => { const writableObjectMode = index !== 0 && newGenerators[index - 1].value.readableObjectMode; const readableObjectMode = objectMode; const readableObjectMode = objectMode ?? writableObjectMode; return {writableObjectMode, readableObjectMode};};
const getInputObjectModes = (objectMode, index, newGenerators) => { const writableObjectMode = index === 0 ? objectMode ? objectMode === true : newGenerators[index - 1].value.readableObjectMode; const readableObjectMode = index !== newGenerators.length - 1 && objectMode; const readableObjectMode = index !== newGenerators.length - 1 && (objectMode ?? writableObjectMode); return {writableObjectMode, readableObjectMode};};
const sortGenerators = newGenerators => newGenerators[0]?.direction === 'input' ? newGenerators.reverse() : newGenerators;51 unmodified linesmodified:test/helpers/generator.js+4 added
1 import {setImmediate, setInterval} from 'node:timers/promises';2 import {foobarObject} from './input.js';3 4+export const addNoopGenerator = (transform, addNoopTransform) => addNoopTransform5+ ? [transform, noopGenerator(undefined, true)]6+ : [transform];7+8 export const noopGenerator = (objectMode, binary) => ({9 * transform(line) {10 yield line;11 },60 unmodified linesmodified:test/stdio/encoding-final.js+19 added-12 removed
5 unmodified lines6 import getStream, {getStreamAsBuffer} from 'get-stream';7 import {execa, execaSync} from '../../index.js';8 import {setFixtureDir, FIXTURES_DIR} from '../helpers/fixtures-dir.js';9 import {fullStdio} from '../helpers/stdio.js';10-import {outputObjectGenerator, getChunksGenerator} from '../helpers/generator.js';10+import {outputObjectGenerator, getChunksGenerator, addNoopGenerator} from '../helpers/generator.js';11 import {foobarObject} from '../helpers/input.js';12 13 const pExec = promisify(exec);14 120 unmodified lines135 });136 137 const foobarArray = ['fo', 'ob', 'ar', '..'];138 139-test('Handle multibyte characters', async t => {140- const {stdout} = await execa('noop.js', {stdout: getChunksGenerator(foobarArray, false), encoding: 'base64'});141- t.is(stdout, btoa(foobarArray.join('')));142-});139+const testMultibyteCharacters = async (t, objectMode, addNoopTransform) => {140+ const {stdout} = await execa('noop.js', {stdout: addNoopGenerator(getChunksGenerator(foobarArray, objectMode), addNoopTransform), encoding: 'base64'});141+ if (objectMode) {142+ t.deepEqual(stdout, foobarArray.map(chunk => btoa(chunk)));143+ } else {144+ t.is(stdout, btoa(foobarArray.join('')));145+ }146+};147 144-test('Handle multibyte characters, with objectMode', async t => {145- const {stdout} = await execa('noop.js', {stdout: getChunksGenerator(foobarArray, true), encoding: 'base64'});146- t.deepEqual(stdout, foobarArray.map(chunk => btoa(chunk)));147-});148+test('Handle multibyte characters', testMultibyteCharacters, false, false);149+test('Handle multibyte characters, noop transform', testMultibyteCharacters, false, true);150+test('Handle multibyte characters, with objectMode', testMultibyteCharacters, true, false);151+test('Handle multibyte characters, with objectMode, noop transform', testMultibyteCharacters, true, true);152 149-test('Other encodings work with transforms that return objects', async t => {150- const {stdout} = await execa('noop.js', {stdout: outputObjectGenerator, encoding: 'base64'});153+const testObjectMode = async (t, addNoopTransform) => {154+ const {stdout} = await execa('noop.js', {stdout: addNoopGenerator(outputObjectGenerator, addNoopTransform), encoding: 'base64'});155 t.deepEqual(stdout, [foobarObject]);152-});156+};157 158+test('Other encodings work with transforms that return objects', testObjectMode, false);159+test('Other encodings work with transforms that return objects, noop transform', testObjectMode, true);160+161 const testIgnoredEncoding = async (t, stdoutOption, isUndefined, options) => {162 const {stdout} = await execa('empty.js', {stdout: stdoutOption, ...options});163 t.is(stdout === undefined, isUndefined);164 };39 unmodified linesmodified:test/stdio/generator.js+128 added-66 removed
5 unmodified lines6 import {execa} from '../../index.js';7 import {setFixtureDir} from '../helpers/fixtures-dir.js';8 import {getStdio} from '../helpers/stdio.js';9 import {foobarString, foobarUint8Array, foobarBuffer, foobarObject, foobarObjectString} from '../helpers/input.js';10-import {serializeGenerator, outputObjectGenerator} from '../helpers/generator.js';10+import {serializeGenerator, outputObjectGenerator, addNoopGenerator} from '../helpers/generator.js';11 12 setFixtureDir();13 14 const textEncoder = new TextEncoder();9 unmodified lines24 const uppercaseBufferGenerator = function * (line) {25 yield textDecoder.decode(line).toUpperCase();26 };27 28-const getInputObjectMode = objectMode => objectMode29- ? {input: [foobarObject], generator: serializeGenerator, output: foobarObjectString}30- : {input: foobarUint8Array, generator: uppercaseGenerator, output: foobarUppercase};28+const getInputObjectMode = (objectMode, addNoopTransform) => objectMode29+ ? {30+ input: [foobarObject],31+ generators: addNoopGenerator(serializeGenerator, addNoopTransform),32+ output: foobarObjectString,33+ }34+ : {35+ input: foobarUint8Array,36+ generators: addNoopGenerator(uppercaseGenerator, addNoopTransform),37+ output: foobarUppercase,38+ };39 32-const getOutputObjectMode = objectMode => objectMode33- ? {generator: outputObjectGenerator, output: [foobarObject], getStreamMethod: getStreamAsArray}34- : {generator: uppercaseGenerator, output: foobarUppercase, getStreamMethod: getStream};40+const getOutputObjectMode = (objectMode, addNoopTransform) => objectMode41+ ? {42+ generators: addNoopGenerator(outputObjectGenerator, addNoopTransform),43+ output: [foobarObject],44+ getStreamMethod: getStreamAsArray,45+ }46+ : {47+ generators: addNoopGenerator(uppercaseGenerator, addNoopGenerator),48+ output: foobarUppercase,49+ getStreamMethod: getStream,50+ };51 36-const testGeneratorInput = async (t, fdNumber, objectMode) => {37- const {input, generator, output} = getInputObjectMode(objectMode);38- const {stdout} = await execa('stdin-fd.js', [`${fdNumber}`], getStdio(fdNumber, [input, generator]));52+const testGeneratorInput = async (t, fdNumber, objectMode, addNoopTransform) => {53+ const {input, generators, output} = getInputObjectMode(objectMode, addNoopTransform);54+ const {stdout} = await execa('stdin-fd.js', [`${fdNumber}`], getStdio(fdNumber, [input, ...generators]));55 t.is(stdout, output);56 };57 42-test('Can use generators with result.stdin', testGeneratorInput, 0, false);43-test('Can use generators with result.stdio[*] as input', testGeneratorInput, 3, false);44-test('Can use generators with result.stdin, objectMode', testGeneratorInput, 0, true);45-test('Can use generators with result.stdio[*] as input, objectMode', testGeneratorInput, 3, true);58+test('Can use generators with result.stdin', testGeneratorInput, 0, false, false);59+test('Can use generators with result.stdio[*] as input', testGeneratorInput, 3, false, false);60+test('Can use generators with result.stdin, objectMode', testGeneratorInput, 0, true, false);61+test('Can use generators with result.stdio[*] as input, objectMode', testGeneratorInput, 3, true, false);62+test('Can use generators with result.stdin, noop transform', testGeneratorInput, 0, false, true);63+test('Can use generators with result.stdio[*] as input, noop transform', testGeneratorInput, 3, false, true);64+test('Can use generators with result.stdin, objectMode, noop transform', testGeneratorInput, 0, true, true);65+test('Can use generators with result.stdio[*] as input, objectMode, noop transform', testGeneratorInput, 3, true, true);66 67+// eslint-disable-next-line max-params47-const testGeneratorInputPipe = async (t, useShortcutProperty, objectMode, input) => {48- const {generator, output} = getInputObjectMode(objectMode);49- const childProcess = execa('stdin-fd.js', ['0'], getStdio(0, generator));68+const testGeneratorInputPipe = async (t, useShortcutProperty, objectMode, addNoopTransform, input) => {69+ const {generators, output} = getInputObjectMode(objectMode, addNoopTransform);70+ const childProcess = execa('stdin-fd.js', ['0'], getStdio(0, generators));71 const stream = useShortcutProperty ? childProcess.stdin : childProcess.stdio[0];72 stream.end(...input);73 const {stdout} = await childProcess;74 t.is(stdout, output);75 };76 56-test('Can use generators with childProcess.stdio[0] and default encoding', testGeneratorInputPipe, false, false, [foobarString, 'utf8']);57-test('Can use generators with childProcess.stdin and default encoding', testGeneratorInputPipe, true, false, [foobarString, 'utf8']);58-test('Can use generators with childProcess.stdio[0] and encoding "buffer"', testGeneratorInputPipe, false, false, [foobarBuffer, 'buffer']);59-test('Can use generators with childProcess.stdin and encoding "buffer"', testGeneratorInputPipe, true, false, [foobarBuffer, 'buffer']);60-test('Can use generators with childProcess.stdio[0] and encoding "hex"', testGeneratorInputPipe, false, false, [foobarHex, 'hex']);61-test('Can use generators with childProcess.stdin and encoding "hex"', testGeneratorInputPipe, true, false, [foobarHex, 'hex']);62-test('Can use generators with childProcess.stdio[0], objectMode', testGeneratorInputPipe, false, true, [foobarObject]);63-test('Can use generators with childProcess.stdin, objectMode', testGeneratorInputPipe, true, true, [foobarObject]);77+test('Can use generators with childProcess.stdio[0] and default encoding', testGeneratorInputPipe, false, false, false, [foobarString, 'utf8']);78+test('Can use generators with childProcess.stdin and default encoding', testGeneratorInputPipe, true, false, false, [foobarString, 'utf8']);79+test('Can use generators with childProcess.stdio[0] and encoding "buffer"', testGeneratorInputPipe, false, false, false, [foobarBuffer, 'buffer']);80+test('Can use generators with childProcess.stdin and encoding "buffer"', testGeneratorInputPipe, true, false, false, [foobarBuffer, 'buffer']);81+test('Can use generators with childProcess.stdio[0] and encoding "hex"', testGeneratorInputPipe, false, false, false, [foobarHex, 'hex']);82+test('Can use generators with childProcess.stdin and encoding "hex"', testGeneratorInputPipe, true, false, false, [foobarHex, 'hex']);83+test('Can use generators with childProcess.stdio[0], objectMode', testGeneratorInputPipe, false, true, false, [foobarObject]);84+test('Can use generators with childProcess.stdin, objectMode', testGeneratorInputPipe, true, true, false, [foobarObject]);85+test('Can use generators with childProcess.stdio[0] and default encoding, noop transform', testGeneratorInputPipe, false, false, true, [foobarString, 'utf8']);86+test('Can use generators with childProcess.stdin and default encoding, noop transform', testGeneratorInputPipe, true, false, true, [foobarString, 'utf8']);87+test('Can use generators with childProcess.stdio[0] and encoding "buffer", noop transform', testGeneratorInputPipe, false, false, true, [foobarBuffer, 'buffer']);88+test('Can use generators with childProcess.stdin and encoding "buffer", noop transform', testGeneratorInputPipe, true, false, true, [foobarBuffer, 'buffer']);89+test('Can use generators with childProcess.stdio[0] and encoding "hex", noop transform', testGeneratorInputPipe, false, false, true, [foobarHex, 'hex']);90+test('Can use generators with childProcess.stdin and encoding "hex", noop transform', testGeneratorInputPipe, true, false, true, [foobarHex, 'hex']);91+test('Can use generators with childProcess.stdio[0], objectMode, noop transform', testGeneratorInputPipe, false, true, true, [foobarObject]);92+test('Can use generators with childProcess.stdin, objectMode, noop transform', testGeneratorInputPipe, true, true, true, [foobarObject]);93 65-const testGeneratorStdioInputPipe = async (t, objectMode) => {66- const {input, generator, output} = getInputObjectMode(objectMode);67- const childProcess = execa('stdin-fd.js', ['3'], getStdio(3, [new Uint8Array(), generator]));94+const testGeneratorStdioInputPipe = async (t, objectMode, addNoopTransform) => {95+ const {input, generators, output} = getInputObjectMode(objectMode, addNoopTransform);96+ const childProcess = execa('stdin-fd.js', ['3'], getStdio(3, [new Uint8Array(), ...generators]));97 childProcess.stdio[3].write(Array.isArray(input) ? input[0] : input);98 const {stdout} = await childProcess;99 t.is(stdout, output);100 };101 73-test('Can use generators with childProcess.stdio[*] as input', testGeneratorStdioInputPipe, false);74-test('Can use generators with childProcess.stdio[*] as input, objectMode', testGeneratorStdioInputPipe, true);102+test('Can use generators with childProcess.stdio[*] as input', testGeneratorStdioInputPipe, false, false);103+test('Can use generators with childProcess.stdio[*] as input, objectMode', testGeneratorStdioInputPipe, true, false);104+test('Can use generators with childProcess.stdio[*] as input, noop transform', testGeneratorStdioInputPipe, false, true);105+test('Can use generators with childProcess.stdio[*] as input, objectMode, noop transform', testGeneratorStdioInputPipe, true, true);106 107 // eslint-disable-next-line max-params77-const testGeneratorOutput = async (t, fdNumber, reject, useShortcutProperty, objectMode) => {78- const {generator, output} = getOutputObjectMode(objectMode);108+const testGeneratorOutput = async (t, fdNumber, reject, useShortcutProperty, objectMode, addNoopTransform) => {109+ const {generators, output} = getOutputObjectMode(objectMode, addNoopTransform);110 const fixtureName = reject ? 'noop-fd.js' : 'noop-fail.js';80- const {stdout, stderr, stdio} = await execa(fixtureName, [`${fdNumber}`, foobarString], {...getStdio(fdNumber, generator), reject});111+ const {stdout, stderr, stdio} = await execa(fixtureName, [`${fdNumber}`, foobarString], {...getStdio(fdNumber, generators), reject});112 const result = useShortcutProperty ? [stdout, stderr][fdNumber - 1] : stdio[fdNumber];113 t.deepEqual(result, output);114 };115 85-test('Can use generators with result.stdio[1]', testGeneratorOutput, 1, true, false, false);86-test('Can use generators with result.stdout', testGeneratorOutput, 1, true, true, false);87-test('Can use generators with result.stdio[2]', testGeneratorOutput, 2, true, false, false);88-test('Can use generators with result.stderr', testGeneratorOutput, 2, true, true, false);89-test('Can use generators with result.stdio[*] as output', testGeneratorOutput, 3, true, false, false);90-test('Can use generators with error.stdio[1]', testGeneratorOutput, 1, false, false, false);91-test('Can use generators with error.stdout', testGeneratorOutput, 1, false, true, false);92-test('Can use generators with error.stdio[2]', testGeneratorOutput, 2, false, false, false);93-test('Can use generators with error.stderr', testGeneratorOutput, 2, false, true, false);94-test('Can use generators with error.stdio[*] as output', testGeneratorOutput, 3, false, false, false);95-test('Can use generators with result.stdio[1], objectMode', testGeneratorOutput, 1, true, false, true);96-test('Can use generators with result.stdout, objectMode', testGeneratorOutput, 1, true, true, true);97-test('Can use generators with result.stdio[2], objectMode', testGeneratorOutput, 2, true, false, true);98-test('Can use generators with result.stderr, objectMode', testGeneratorOutput, 2, true, true, true);99-test('Can use generators with result.stdio[*] as output, objectMode', testGeneratorOutput, 3, true, false, true);100-test('Can use generators with error.stdio[1], objectMode', testGeneratorOutput, 1, false, false, true);101-test('Can use generators with error.stdout, objectMode', testGeneratorOutput, 1, false, true, true);102-test('Can use generators with error.stdio[2], objectMode', testGeneratorOutput, 2, false, false, true);103-test('Can use generators with error.stderr, objectMode', testGeneratorOutput, 2, false, true, true);104-test('Can use generators with error.stdio[*] as output, objectMode', testGeneratorOutput, 3, false, false, true);116+test('Can use generators with result.stdio[1]', testGeneratorOutput, 1, true, false, false, false);117+test('Can use generators with result.stdout', testGeneratorOutput, 1, true, true, false, false);118+test('Can use generators with result.stdio[2]', testGeneratorOutput, 2, true, false, false, false);119+test('Can use generators with result.stderr', testGeneratorOutput, 2, true, true, false, false);120+test('Can use generators with result.stdio[*] as output', testGeneratorOutput, 3, true, false, false, false);121+test('Can use generators with error.stdio[1]', testGeneratorOutput, 1, false, false, false, false);122+test('Can use generators with error.stdout', testGeneratorOutput, 1, false, true, false, false);123+test('Can use generators with error.stdio[2]', testGeneratorOutput, 2, false, false, false, false);124+test('Can use generators with error.stderr', testGeneratorOutput, 2, false, true, false, false);125+test('Can use generators with error.stdio[*] as output', testGeneratorOutput, 3, false, false, false, false);126+test('Can use generators with result.stdio[1], objectMode', testGeneratorOutput, 1, true, false, true, false);127+test('Can use generators with result.stdout, objectMode', testGeneratorOutput, 1, true, true, true, false);128+test('Can use generators with result.stdio[2], objectMode', testGeneratorOutput, 2, true, false, true, false);129+test('Can use generators with result.stderr, objectMode', testGeneratorOutput, 2, true, true, true, false);130+test('Can use generators with result.stdio[*] as output, objectMode', testGeneratorOutput, 3, true, false, true, false);131+test('Can use generators with error.stdio[1], objectMode', testGeneratorOutput, 1, false, false, true, false);132+test('Can use generators with error.stdout, objectMode', testGeneratorOutput, 1, false, true, true, false);133+test('Can use generators with error.stdio[2], objectMode', testGeneratorOutput, 2, false, false, true, false);134+test('Can use generators with error.stderr, objectMode', testGeneratorOutput, 2, false, true, true, false);135+test('Can use generators with error.stdio[*] as output, objectMode', testGeneratorOutput, 3, false, false, true, false);136+test('Can use generators with result.stdio[1], noop transform', testGeneratorOutput, 1, true, false, false, true);137+test('Can use generators with result.stdout, noop transform', testGeneratorOutput, 1, true, true, false, true);138+test('Can use generators with result.stdio[2], noop transform', testGeneratorOutput, 2, true, false, false, true);139+test('Can use generators with result.stderr, noop transform', testGeneratorOutput, 2, true, true, false, true);140+test('Can use generators with result.stdio[*] as output, noop transform', testGeneratorOutput, 3, true, false, false, true);141+test('Can use generators with error.stdio[1], noop transform', testGeneratorOutput, 1, false, false, false, true);142+test('Can use generators with error.stdout, noop transform', testGeneratorOutput, 1, false, true, false, true);143+test('Can use generators with error.stdio[2], noop transform', testGeneratorOutput, 2, false, false, false, true);144+test('Can use generators with error.stderr, noop transform', testGeneratorOutput, 2, false, true, false, true);145+test('Can use generators with error.stdio[*] as output, noop transform', testGeneratorOutput, 3, false, false, false, true);146+test('Can use generators with result.stdio[1], objectMode, noop transform', testGeneratorOutput, 1, true, false, true, true);147+test('Can use generators with result.stdout, objectMode, noop transform', testGeneratorOutput, 1, true, true, true, true);148+test('Can use generators with result.stdio[2], objectMode, noop transform', testGeneratorOutput, 2, true, false, true, true);149+test('Can use generators with result.stderr, objectMode, noop transform', testGeneratorOutput, 2, true, true, true, true);150+test('Can use generators with result.stdio[*] as output, objectMode, noop transform', testGeneratorOutput, 3, true, false, true, true);151+test('Can use generators with error.stdio[1], objectMode, noop transform', testGeneratorOutput, 1, false, false, true, true);152+test('Can use generators with error.stdout, objectMode, noop transform', testGeneratorOutput, 1, false, true, true, true);153+test('Can use generators with error.stdio[2], objectMode, noop transform', testGeneratorOutput, 2, false, false, true, true);154+test('Can use generators with error.stderr, objectMode, noop transform', testGeneratorOutput, 2, false, true, true, true);155+test('Can use generators with error.stdio[*] as output, objectMode, noop transform', testGeneratorOutput, 3, false, false, true, true);156 157+// eslint-disable-next-line max-params106-const testGeneratorOutputPipe = async (t, fdNumber, useShortcutProperty, objectMode) => {107- const {generator, output, getStreamMethod} = getOutputObjectMode(objectMode);108- const childProcess = execa('noop-fd.js', [`${fdNumber}`, foobarString], {...getStdio(fdNumber, generator), buffer: false});158+const testGeneratorOutputPipe = async (t, fdNumber, useShortcutProperty, objectMode, addNoopTransform) => {159+ const {generators, output, getStreamMethod} = getOutputObjectMode(objectMode, addNoopTransform);160+ const childProcess = execa('noop-fd.js', [`${fdNumber}`, foobarString], {...getStdio(fdNumber, generators), buffer: false});161 const stream = useShortcutProperty ? [childProcess.stdout, childProcess.stderr][fdNumber - 1] : childProcess.stdio[fdNumber];162 const [result] = await Promise.all([getStreamMethod(stream), childProcess]);163 t.deepEqual(result, output);164 };165 114-test('Can use generators with childProcess.stdio[1]', testGeneratorOutputPipe, 1, false, false);115-test('Can use generators with childProcess.stdout', testGeneratorOutputPipe, 1, true, false);116-test('Can use generators with childProcess.stdio[2]', testGeneratorOutputPipe, 2, false, false);117-test('Can use generators with childProcess.stderr', testGeneratorOutputPipe, 2, true, false);118-test('Can use generators with childProcess.stdio[*] as output', testGeneratorOutputPipe, 3, false, false);119-test('Can use generators with childProcess.stdio[1], objectMode', testGeneratorOutputPipe, 1, false, true);120-test('Can use generators with childProcess.stdout, objectMode', testGeneratorOutputPipe, 1, true, true);121-test('Can use generators with childProcess.stdio[2], objectMode', testGeneratorOutputPipe, 2, false, true);122-test('Can use generators with childProcess.stderr, objectMode', testGeneratorOutputPipe, 2, true, true);123-test('Can use generators with childProcess.stdio[*] as output, objectMode', testGeneratorOutputPipe, 3, false, true);166+test('Can use generators with childProcess.stdio[1]', testGeneratorOutputPipe, 1, false, false, false);167+test('Can use generators with childProcess.stdout', testGeneratorOutputPipe, 1, true, false, false);168+test('Can use generators with childProcess.stdio[2]', testGeneratorOutputPipe, 2, false, false, false);169+test('Can use generators with childProcess.stderr', testGeneratorOutputPipe, 2, true, false, false);170+test('Can use generators with childProcess.stdio[*] as output', testGeneratorOutputPipe, 3, false, false, false);171+test('Can use generators with childProcess.stdio[1], objectMode', testGeneratorOutputPipe, 1, false, true, false);172+test('Can use generators with childProcess.stdout, objectMode', testGeneratorOutputPipe, 1, true, true, false);173+test('Can use generators with childProcess.stdio[2], objectMode', testGeneratorOutputPipe, 2, false, true, false);174+test('Can use generators with childProcess.stderr, objectMode', testGeneratorOutputPipe, 2, true, true, false);175+test('Can use generators with childProcess.stdio[*] as output, objectMode', testGeneratorOutputPipe, 3, false, true, false);176+test('Can use generators with childProcess.stdio[1], noop transform', testGeneratorOutputPipe, 1, false, false, true);177+test('Can use generators with childProcess.stdout, noop transform', testGeneratorOutputPipe, 1, true, false, true);178+test('Can use generators with childProcess.stdio[2], noop transform', testGeneratorOutputPipe, 2, false, false, true);179+test('Can use generators with childProcess.stderr, noop transform', testGeneratorOutputPipe, 2, true, false, true);180+test('Can use generators with childProcess.stdio[*] as output, noop transform', testGeneratorOutputPipe, 3, false, false, true);181+test('Can use generators with childProcess.stdio[1], objectMode, noop transform', testGeneratorOutputPipe, 1, false, true, true);182+test('Can use generators with childProcess.stdout, objectMode, noop transform', testGeneratorOutputPipe, 1, true, true, true);183+test('Can use generators with childProcess.stdio[2], objectMode, noop transform', testGeneratorOutputPipe, 2, false, true, true);184+test('Can use generators with childProcess.stderr, objectMode, noop transform', testGeneratorOutputPipe, 2, true, true, true);185+test('Can use generators with childProcess.stdio[*] as output, objectMode, noop transform', testGeneratorOutputPipe, 3, false, true, true);186 187 const getAllStdioOption = (stdioOption, encoding, objectMode) => {188 if (stdioOption) {189 return 'pipe';160 unmodified lines