generator.js
This file
Path
test/stdio/generator.js
779 lines · 79.7 KiB · JavaScript
Last changed by
Fix `lines` option (#957)ehmickybefore adoption15ab4e6
History of this fileTake it
Improve handling of `encoding` option (#926)ehmickybefore adoptiond786fcf
line 1why, one step back1import {Buffer} from 'node:buffer';Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 2why, one step back2import {readFile, writeFile, rm} from 'node:fs/promises';Split files (#837)ehmickybefore adoption672c2d7
line 3why, one step back3import {PassThrough} from 'node:stream';Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 4why, one step back4import test from 'ava';Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
line 5why, one step back5import getStream, {getStreamAsArray} from 'get-stream';Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 6why, one step back6import tempfile from 'tempfile';Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
line 7why, one step back7import {execa, execaSync} from '../../index.js';Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
lines 8–9why, one step back8import {setFixtureDir} from '../helpers/fixtures-dir.js';9import {getStdio} from '../helpers/stdio.js';Refactor tests (#934)ehmickybefore adoption52c4bde
lines 10–23why, one step back10import {11 foobarString,12 foobarUppercase,13 foobarHex,14 foobarUint8Array,15 foobarBuffer,16 foobarObject,17 foobarObjectString,18} from '../helpers/input.js';19import {20 outputObjectGenerator,21 uppercaseGenerator,22 uppercaseBufferGenerator,23 appendGenerator,Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
line 24why, one step back24 appendAsyncGenerator,Refactor tests (#934)ehmickybefore adoption52c4bde
lines 25–26why, one step back25 casedSuffix,26} from '../helpers/generator.js';Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 27why, one step back27import {appendDuplex, uppercaseBufferDuplex} from '../helpers/duplex.js';Add support for `std*: TransformStream` option (#938)ehmickybefore adoption45824d6
line 28why, one step back28import {appendWebTransform, uppercaseBufferWebTransform} from '../helpers/web-transform.js';Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 29why, one step back29import {generatorsMap} from '../helpers/map.js';Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
lines 30–32why, one step back3031setFixtureDir();32Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
lines 33–34why, one step back33const textEncoder = new TextEncoder();34Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 35why, one step back35const getInputObjectMode = (objectMode, addNoopTransform, type) => objectModeImprove default value of transforms `objectMode` (#867)ehmickybefore adoption8f51c6b
lines 36–37why, one step back36 ? {37 input: [foobarObject],Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 38why, one step back38 generators: generatorsMap[type].addNoop(generatorsMap[type].serialize(objectMode), addNoopTransform, objectMode),Improve default value of transforms `objectMode` (#867)ehmickybefore adoption8f51c6b
lines 39–42why, one step back39 output: foobarObjectString,40 }41 : {42 input: foobarUint8Array,Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 43why, one step back43 generators: generatorsMap[type].addNoop(generatorsMap[type].uppercase(objectMode), addNoopTransform, objectMode),Improve default value of transforms `objectMode` (#867)ehmickybefore adoption8f51c6b
lines 44–45why, one step back44 output: foobarUppercase,45 };Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 46why, one step back46Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 47why, one step back47const getOutputObjectMode = (objectMode, addNoopTransform, type, binary) => objectModeImprove default value of transforms `objectMode` (#867)ehmickybefore adoption8f51c6b
line 48why, one step back48 ? {Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 49why, one step back49 generators: generatorsMap[type].addNoop(generatorsMap[type].outputObject(), addNoopTransform, objectMode, binary),Improve default value of transforms `objectMode` (#867)ehmickybefore adoption8f51c6b
lines 50–53why, one step back50 output: [foobarObject],51 getStreamMethod: getStreamAsArray,52 }53 : {Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 54why, one step back54 generators: generatorsMap[type].addNoop(generatorsMap[type].uppercaseBuffer(objectMode, true), addNoopTransform, objectMode, binary),Improve default value of transforms `objectMode` (#867)ehmickybefore adoption8f51c6b
lines 55–57why, one step back55 output: foobarUppercase,56 getStreamMethod: getStream,57 };Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
line 58why, one step back58Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 59why, one step back59// eslint-disable-next-line max-paramsAdd support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
line 60why, one step back60const testGeneratorInput = async (t, fdNumber, objectMode, addNoopTransform, type, execaMethod) => {Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 61why, one step back61 const {input, generators, output} = getInputObjectMode(objectMode, addNoopTransform, type);Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
line 62why, one step back62 const {stdout} = await execaMethod('stdin-fd.js', [`${fdNumber}`], getStdio(fdNumber, [input, ...generators]));Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
lines 63–65why, one step back63 t.is(stdout, output);64};65Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
lines 66–93why, one step back66test('Can use generators with result.stdin', testGeneratorInput, 0, false, false, 'generator', execa);67test('Can use generators with result.stdio[*] as input', testGeneratorInput, 3, false, false, 'generator', execa);68test('Can use generators with result.stdin, objectMode', testGeneratorInput, 0, true, false, 'generator', execa);69test('Can use generators with result.stdio[*] as input, objectMode', testGeneratorInput, 3, true, false, 'generator', execa);70test('Can use generators with result.stdin, noop transform', testGeneratorInput, 0, false, true, 'generator', execa);71test('Can use generators with result.stdio[*] as input, noop transform', testGeneratorInput, 3, false, true, 'generator', execa);72test('Can use generators with result.stdin, objectMode, noop transform', testGeneratorInput, 0, true, true, 'generator', execa);73test('Can use generators with result.stdio[*] as input, objectMode, noop transform', testGeneratorInput, 3, true, true, 'generator', execa);74test('Can use generators with result.stdin, sync', testGeneratorInput, 0, false, false, 'generator', execaSync);75test('Can use generators with result.stdin, objectMode, sync', testGeneratorInput, 0, true, false, 'generator', execaSync);76test('Can use generators with result.stdin, noop transform, sync', testGeneratorInput, 0, false, true, 'generator', execaSync);77test('Can use generators with result.stdin, objectMode, noop transform, sync', testGeneratorInput, 0, true, true, 'generator', execaSync);78test('Can use duplexes with result.stdin', testGeneratorInput, 0, false, false, 'duplex', execa);79test('Can use duplexes with result.stdio[*] as input', testGeneratorInput, 3, false, false, 'duplex', execa);80test('Can use duplexes with result.stdin, objectMode', testGeneratorInput, 0, true, false, 'duplex', execa);81test('Can use duplexes with result.stdio[*] as input, objectMode', testGeneratorInput, 3, true, false, 'duplex', execa);82test('Can use duplexes with result.stdin, noop transform', testGeneratorInput, 0, false, true, 'duplex', execa);83test('Can use duplexes with result.stdio[*] as input, noop transform', testGeneratorInput, 3, false, true, 'duplex', execa);84test('Can use duplexes with result.stdin, objectMode, noop transform', testGeneratorInput, 0, true, true, 'duplex', execa);85test('Can use duplexes with result.stdio[*] as input, objectMode, noop transform', testGeneratorInput, 3, true, true, 'duplex', execa);86test('Can use webTransforms with result.stdin', testGeneratorInput, 0, false, false, 'webTransform', execa);87test('Can use webTransforms with result.stdio[*] as input', testGeneratorInput, 3, false, false, 'webTransform', execa);88test('Can use webTransforms with result.stdin, objectMode', testGeneratorInput, 0, true, false, 'webTransform', execa);89test('Can use webTransforms with result.stdio[*] as input, objectMode', testGeneratorInput, 3, true, false, 'webTransform', execa);90test('Can use webTransforms with result.stdin, noop transform', testGeneratorInput, 0, false, true, 'webTransform', execa);91test('Can use webTransforms with result.stdio[*] as input, noop transform', testGeneratorInput, 3, false, true, 'webTransform', execa);92test('Can use webTransforms with result.stdin, objectMode, noop transform', testGeneratorInput, 0, true, true, 'webTransform', execa);93test('Can use webTransforms with result.stdio[*] as input, objectMode, noop transform', testGeneratorInput, 3, true, true, 'webTransform', execa);Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
line 94why, one step back94Improve default value of transforms `objectMode` (#867)ehmickybefore adoption8f51c6b
line 95why, one step back95// eslint-disable-next-line max-paramsAdd support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
lines 96–97why, one step back96const testGeneratorInputPipe = async (t, useShortcutProperty, objectMode, addNoopTransform, type, input) => {97 const {generators, output} = getInputObjectMode(objectMode, addNoopTransform, type);Rename `spawned` and `child process` to `subprocess` (#897)ehmickybefore adoption8fe2343
lines 98–99why, one step back98 const subprocess = execa('stdin-fd.js', ['0'], getStdio(0, generators));99 const stream = useShortcutProperty ? subprocess.stdin : subprocess.stdio[0];Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
line 100why, one step back100 stream.end(...input);Rename `spawned` and `child process` to `subprocess` (#897)ehmickybefore adoption8fe2343
line 101why, one step back101 const {stdout} = await subprocess;Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
line 102why, one step back102 t.is(stdout, output);Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
lines 103–104why, one step back103};104Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
lines 105–136why, one step back105test('Can use generators with subprocess.stdio[0] and default encoding', testGeneratorInputPipe, false, false, false, 'generator', [foobarString, 'utf8']);106test('Can use generators with subprocess.stdin and default encoding', testGeneratorInputPipe, true, false, false, 'generator', [foobarString, 'utf8']);107test('Can use generators with subprocess.stdio[0] and encoding "buffer"', testGeneratorInputPipe, false, false, false, 'generator', [foobarBuffer, 'buffer']);108test('Can use generators with subprocess.stdin and encoding "buffer"', testGeneratorInputPipe, true, false, false, 'generator', [foobarBuffer, 'buffer']);109test('Can use generators with subprocess.stdio[0] and encoding "hex"', testGeneratorInputPipe, false, false, false, 'generator', [foobarHex, 'hex']);110test('Can use generators with subprocess.stdin and encoding "hex"', testGeneratorInputPipe, true, false, false, 'generator', [foobarHex, 'hex']);111test('Can use generators with subprocess.stdio[0], objectMode', testGeneratorInputPipe, false, true, false, 'generator', [foobarObject]);112test('Can use generators with subprocess.stdin, objectMode', testGeneratorInputPipe, true, true, false, 'generator', [foobarObject]);113test('Can use generators with subprocess.stdio[0] and default encoding, noop transform', testGeneratorInputPipe, false, false, true, 'generator', [foobarString, 'utf8']);114test('Can use generators with subprocess.stdin and default encoding, noop transform', testGeneratorInputPipe, true, false, true, 'generator', [foobarString, 'utf8']);115test('Can use generators with subprocess.stdio[0] and encoding "buffer", noop transform', testGeneratorInputPipe, false, false, true, 'generator', [foobarBuffer, 'buffer']);116test('Can use generators with subprocess.stdin and encoding "buffer", noop transform', testGeneratorInputPipe, true, false, true, 'generator', [foobarBuffer, 'buffer']);117test('Can use generators with subprocess.stdio[0] and encoding "hex", noop transform', testGeneratorInputPipe, false, false, true, 'generator', [foobarHex, 'hex']);118test('Can use generators with subprocess.stdin and encoding "hex", noop transform', testGeneratorInputPipe, true, false, true, 'generator', [foobarHex, 'hex']);119test('Can use generators with subprocess.stdio[0], objectMode, noop transform', testGeneratorInputPipe, false, true, true, 'generator', [foobarObject]);120test('Can use generators with subprocess.stdin, objectMode, noop transform', testGeneratorInputPipe, true, true, true, 'generator', [foobarObject]);121test('Can use duplexes with subprocess.stdio[0] and default encoding', testGeneratorInputPipe, false, false, false, 'duplex', [foobarString, 'utf8']);122test('Can use duplexes with subprocess.stdin and default encoding', testGeneratorInputPipe, true, false, false, 'duplex', [foobarString, 'utf8']);123test('Can use duplexes with subprocess.stdio[0] and encoding "buffer"', testGeneratorInputPipe, false, false, false, 'duplex', [foobarBuffer, 'buffer']);124test('Can use duplexes with subprocess.stdin and encoding "buffer"', testGeneratorInputPipe, true, false, false, 'duplex', [foobarBuffer, 'buffer']);125test('Can use duplexes with subprocess.stdio[0] and encoding "hex"', testGeneratorInputPipe, false, false, false, 'duplex', [foobarHex, 'hex']);126test('Can use duplexes with subprocess.stdin and encoding "hex"', testGeneratorInputPipe, true, false, false, 'duplex', [foobarHex, 'hex']);127test('Can use duplexes with subprocess.stdio[0], objectMode', testGeneratorInputPipe, false, true, false, 'duplex', [foobarObject]);128test('Can use duplexes with subprocess.stdin, objectMode', testGeneratorInputPipe, true, true, false, 'duplex', [foobarObject]);129test('Can use duplexes with subprocess.stdio[0] and default encoding, noop transform', testGeneratorInputPipe, false, false, true, 'duplex', [foobarString, 'utf8']);130test('Can use duplexes with subprocess.stdin and default encoding, noop transform', testGeneratorInputPipe, true, false, true, 'duplex', [foobarString, 'utf8']);131test('Can use duplexes with subprocess.stdio[0] and encoding "buffer", noop transform', testGeneratorInputPipe, false, false, true, 'duplex', [foobarBuffer, 'buffer']);132test('Can use duplexes with subprocess.stdin and encoding "buffer", noop transform', testGeneratorInputPipe, true, false, true, 'duplex', [foobarBuffer, 'buffer']);133test('Can use duplexes with subprocess.stdio[0] and encoding "hex", noop transform', testGeneratorInputPipe, false, false, true, 'duplex', [foobarHex, 'hex']);134test('Can use duplexes with subprocess.stdin and encoding "hex", noop transform', testGeneratorInputPipe, true, false, true, 'duplex', [foobarHex, 'hex']);135test('Can use duplexes with subprocess.stdio[0], objectMode, noop transform', testGeneratorInputPipe, false, true, true, 'duplex', [foobarObject]);136test('Can use duplexes with subprocess.stdin, objectMode, noop transform', testGeneratorInputPipe, true, true, true, 'duplex', [foobarObject]);Add support for `std*: TransformStream` option (#938)ehmickybefore adoption45824d6
lines 137–152why, one step back137test('Can use webTransforms with subprocess.stdio[0] and default encoding', testGeneratorInputPipe, false, false, false, 'webTransform', [foobarString, 'utf8']);138test('Can use webTransforms with subprocess.stdin and default encoding', testGeneratorInputPipe, true, false, false, 'webTransform', [foobarString, 'utf8']);139test('Can use webTransforms with subprocess.stdio[0] and encoding "buffer"', testGeneratorInputPipe, false, false, false, 'webTransform', [foobarBuffer, 'buffer']);140test('Can use webTransforms with subprocess.stdin and encoding "buffer"', testGeneratorInputPipe, true, false, false, 'webTransform', [foobarBuffer, 'buffer']);141test('Can use webTransforms with subprocess.stdio[0] and encoding "hex"', testGeneratorInputPipe, false, false, false, 'webTransform', [foobarHex, 'hex']);142test('Can use webTransforms with subprocess.stdin and encoding "hex"', testGeneratorInputPipe, true, false, false, 'webTransform', [foobarHex, 'hex']);143test('Can use webTransforms with subprocess.stdio[0], objectMode', testGeneratorInputPipe, false, true, false, 'webTransform', [foobarObject]);144test('Can use webTransforms with subprocess.stdin, objectMode', testGeneratorInputPipe, true, true, false, 'webTransform', [foobarObject]);145test('Can use webTransforms with subprocess.stdio[0] and default encoding, noop transform', testGeneratorInputPipe, false, false, true, 'webTransform', [foobarString, 'utf8']);146test('Can use webTransforms with subprocess.stdin and default encoding, noop transform', testGeneratorInputPipe, true, false, true, 'webTransform', [foobarString, 'utf8']);147test('Can use webTransforms with subprocess.stdio[0] and encoding "buffer", noop transform', testGeneratorInputPipe, false, false, true, 'webTransform', [foobarBuffer, 'buffer']);148test('Can use webTransforms with subprocess.stdin and encoding "buffer", noop transform', testGeneratorInputPipe, true, false, true, 'webTransform', [foobarBuffer, 'buffer']);149test('Can use webTransforms with subprocess.stdio[0] and encoding "hex", noop transform', testGeneratorInputPipe, false, false, true, 'webTransform', [foobarHex, 'hex']);150test('Can use webTransforms with subprocess.stdin and encoding "hex", noop transform', testGeneratorInputPipe, true, false, true, 'webTransform', [foobarHex, 'hex']);151test('Can use webTransforms with subprocess.stdio[0], objectMode, noop transform', testGeneratorInputPipe, false, true, true, 'webTransform', [foobarObject]);152test('Can use webTransforms with subprocess.stdin, objectMode, noop transform', testGeneratorInputPipe, true, true, true, 'webTransform', [foobarObject]);Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 153why, one step back153Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
lines 154–155why, one step back154const testGeneratorStdioInputPipe = async (t, objectMode, addNoopTransform, type) => {155 const {input, generators, output} = getInputObjectMode(objectMode, addNoopTransform, type);Fix strings returned by transforms in `objectMode` (#917)ehmickybefore adoption98f403c
line 156why, one step back156 const subprocess = execa('stdin-fd.js', ['3'], getStdio(3, [[], ...generators]));Rename `spawned` and `child process` to `subprocess` (#897)ehmickybefore adoption8fe2343
lines 157–158why, one step back157 subprocess.stdio[3].write(Array.isArray(input) ? input[0] : input);158 const {stdout} = await subprocess;Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
lines 159–160why, one step back159 t.is(stdout, output);160};Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 161why, one step back161Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
lines 162–169why, one step back162test('Can use generators with subprocess.stdio[*] as input', testGeneratorStdioInputPipe, false, false, 'generator');163test('Can use generators with subprocess.stdio[*] as input, objectMode', testGeneratorStdioInputPipe, true, false, 'generator');164test('Can use generators with subprocess.stdio[*] as input, noop transform', testGeneratorStdioInputPipe, false, true, 'generator');165test('Can use generators with subprocess.stdio[*] as input, objectMode, noop transform', testGeneratorStdioInputPipe, true, true, 'generator');166test('Can use duplexes with subprocess.stdio[*] as input', testGeneratorStdioInputPipe, false, false, 'duplex');167test('Can use duplexes with subprocess.stdio[*] as input, objectMode', testGeneratorStdioInputPipe, true, false, 'duplex');168test('Can use duplexes with subprocess.stdio[*] as input, noop transform', testGeneratorStdioInputPipe, false, true, 'duplex');169test('Can use duplexes with subprocess.stdio[*] as input, objectMode, noop transform', testGeneratorStdioInputPipe, true, true, 'duplex');Add support for `std*: TransformStream` option (#938)ehmickybefore adoption45824d6
lines 170–173why, one step back170test('Can use webTransforms with subprocess.stdio[*] as input', testGeneratorStdioInputPipe, false, false, 'webTransform');171test('Can use webTransforms with subprocess.stdio[*] as input, objectMode', testGeneratorStdioInputPipe, true, false, 'webTransform');172test('Can use webTransforms with subprocess.stdio[*] as input, noop transform', testGeneratorStdioInputPipe, false, true, 'webTransform');173test('Can use webTransforms with subprocess.stdio[*] as input, objectMode, noop transform', testGeneratorStdioInputPipe, true, true, 'webTransform');Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
line 174why, one step back174Do not allow returning `null` from transforms (#737)ehmickybefore adoptiona5761a8
line 175why, one step back175// eslint-disable-next-line max-paramsAdd support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
line 176why, one step back176const testGeneratorOutput = async (t, fdNumber, reject, useShortcutProperty, objectMode, addNoopTransform, type, execaMethod) => {Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 177why, one step back177 const {generators, output} = getOutputObjectMode(objectMode, addNoopTransform, type);Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 178why, one step back178 const fixtureName = reject ? 'noop-fd.js' : 'noop-fail.js';Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
line 179why, one step back179 const {stdout, stderr, stdio} = await execaMethod(fixtureName, [`${fdNumber}`, foobarString], {...getStdio(fdNumber, generators), reject});Rename `index` to `fdNumber` (#862)ehmickybefore adoption295ef40
line 180why, one step back180 const result = useShortcutProperty ? [stdout, stderr][fdNumber - 1] : stdio[fdNumber];Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
line 181why, one step back181 t.deepEqual(result, output);Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
lines 182–183why, one step back182};183Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
lines 184–343why, one step back184test('Can use generators with result.stdio[1]', testGeneratorOutput, 1, true, false, false, false, 'generator', execa);185test('Can use generators with result.stdout', testGeneratorOutput, 1, true, true, false, false, 'generator', execa);186test('Can use generators with result.stdio[2]', testGeneratorOutput, 2, true, false, false, false, 'generator', execa);187test('Can use generators with result.stderr', testGeneratorOutput, 2, true, true, false, false, 'generator', execa);188test('Can use generators with result.stdio[*] as output', testGeneratorOutput, 3, true, false, false, false, 'generator', execa);189test('Can use generators with error.stdio[1]', testGeneratorOutput, 1, false, false, false, false, 'generator', execa);190test('Can use generators with error.stdout', testGeneratorOutput, 1, false, true, false, false, 'generator', execa);191test('Can use generators with error.stdio[2]', testGeneratorOutput, 2, false, false, false, false, 'generator', execa);192test('Can use generators with error.stderr', testGeneratorOutput, 2, false, true, false, false, 'generator', execa);193test('Can use generators with error.stdio[*] as output', testGeneratorOutput, 3, false, false, false, false, 'generator', execa);194test('Can use generators with result.stdio[1], objectMode', testGeneratorOutput, 1, true, false, true, false, 'generator', execa);195test('Can use generators with result.stdout, objectMode', testGeneratorOutput, 1, true, true, true, false, 'generator', execa);196test('Can use generators with result.stdio[2], objectMode', testGeneratorOutput, 2, true, false, true, false, 'generator', execa);197test('Can use generators with result.stderr, objectMode', testGeneratorOutput, 2, true, true, true, false, 'generator', execa);198test('Can use generators with result.stdio[*] as output, objectMode', testGeneratorOutput, 3, true, false, true, false, 'generator', execa);199test('Can use generators with error.stdio[1], objectMode', testGeneratorOutput, 1, false, false, true, false, 'generator', execa);200test('Can use generators with error.stdout, objectMode', testGeneratorOutput, 1, false, true, true, false, 'generator', execa);201test('Can use generators with error.stdio[2], objectMode', testGeneratorOutput, 2, false, false, true, false, 'generator', execa);202test('Can use generators with error.stderr, objectMode', testGeneratorOutput, 2, false, true, true, false, 'generator', execa);203test('Can use generators with error.stdio[*] as output, objectMode', testGeneratorOutput, 3, false, false, true, false, 'generator', execa);204test('Can use generators with result.stdio[1], noop transform', testGeneratorOutput, 1, true, false, false, true, 'generator', execa);205test('Can use generators with result.stdout, noop transform', testGeneratorOutput, 1, true, true, false, true, 'generator', execa);206test('Can use generators with result.stdio[2], noop transform', testGeneratorOutput, 2, true, false, false, true, 'generator', execa);207test('Can use generators with result.stderr, noop transform', testGeneratorOutput, 2, true, true, false, true, 'generator', execa);208test('Can use generators with result.stdio[*] as output, noop transform', testGeneratorOutput, 3, true, false, false, true, 'generator', execa);209test('Can use generators with error.stdio[1], noop transform', testGeneratorOutput, 1, false, false, false, true, 'generator', execa);210test('Can use generators with error.stdout, noop transform', testGeneratorOutput, 1, false, true, false, true, 'generator', execa);211test('Can use generators with error.stdio[2], noop transform', testGeneratorOutput, 2, false, false, false, true, 'generator', execa);212test('Can use generators with error.stderr, noop transform', testGeneratorOutput, 2, false, true, false, true, 'generator', execa);213test('Can use generators with error.stdio[*] as output, noop transform', testGeneratorOutput, 3, false, false, false, true, 'generator', execa);214test('Can use generators with result.stdio[1], objectMode, noop transform', testGeneratorOutput, 1, true, false, true, true, 'generator', execa);215test('Can use generators with result.stdout, objectMode, noop transform', testGeneratorOutput, 1, true, true, true, true, 'generator', execa);216test('Can use generators with result.stdio[2], objectMode, noop transform', testGeneratorOutput, 2, true, false, true, true, 'generator', execa);217test('Can use generators with result.stderr, objectMode, noop transform', testGeneratorOutput, 2, true, true, true, true, 'generator', execa);218test('Can use generators with result.stdio[*] as output, objectMode, noop transform', testGeneratorOutput, 3, true, false, true, true, 'generator', execa);219test('Can use generators with error.stdio[1], objectMode, noop transform', testGeneratorOutput, 1, false, false, true, true, 'generator', execa);220test('Can use generators with error.stdout, objectMode, noop transform', testGeneratorOutput, 1, false, true, true, true, 'generator', execa);221test('Can use generators with error.stdio[2], objectMode, noop transform', testGeneratorOutput, 2, false, false, true, true, 'generator', execa);222test('Can use generators with error.stderr, objectMode, noop transform', testGeneratorOutput, 2, false, true, true, true, 'generator', execa);223test('Can use generators with error.stdio[*] as output, objectMode, noop transform', testGeneratorOutput, 3, false, false, true, true, 'generator', execa);224test('Can use generators with result.stdio[1], sync', testGeneratorOutput, 1, true, false, false, false, 'generator', execaSync);225test('Can use generators with result.stdout, sync', testGeneratorOutput, 1, true, true, false, false, 'generator', execaSync);226test('Can use generators with result.stdio[2], sync', testGeneratorOutput, 2, true, false, false, false, 'generator', execaSync);227test('Can use generators with result.stderr, sync', testGeneratorOutput, 2, true, true, false, false, 'generator', execaSync);228test('Can use generators with result.stdio[*] as output, sync', testGeneratorOutput, 3, true, false, false, false, 'generator', execaSync);229test('Can use generators with error.stdio[1], sync', testGeneratorOutput, 1, false, false, false, false, 'generator', execaSync);230test('Can use generators with error.stdout, sync', testGeneratorOutput, 1, false, true, false, false, 'generator', execaSync);231test('Can use generators with error.stdio[2], sync', testGeneratorOutput, 2, false, false, false, false, 'generator', execaSync);232test('Can use generators with error.stderr, sync', testGeneratorOutput, 2, false, true, false, false, 'generator', execaSync);233test('Can use generators with error.stdio[*] as output, sync', testGeneratorOutput, 3, false, false, false, false, 'generator', execaSync);234test('Can use generators with result.stdio[1], objectMode, sync', testGeneratorOutput, 1, true, false, true, false, 'generator', execaSync);235test('Can use generators with result.stdout, objectMode, sync', testGeneratorOutput, 1, true, true, true, false, 'generator', execaSync);236test('Can use generators with result.stdio[2], objectMode, sync', testGeneratorOutput, 2, true, false, true, false, 'generator', execaSync);237test('Can use generators with result.stderr, objectMode, sync', testGeneratorOutput, 2, true, true, true, false, 'generator', execaSync);238test('Can use generators with result.stdio[*] as output, objectMode, sync', testGeneratorOutput, 3, true, false, true, false, 'generator', execaSync);239test('Can use generators with error.stdio[1], objectMode, sync', testGeneratorOutput, 1, false, false, true, false, 'generator', execaSync);240test('Can use generators with error.stdout, objectMode, sync', testGeneratorOutput, 1, false, true, true, false, 'generator', execaSync);241test('Can use generators with error.stdio[2], objectMode, sync', testGeneratorOutput, 2, false, false, true, false, 'generator', execaSync);242test('Can use generators with error.stderr, objectMode, sync', testGeneratorOutput, 2, false, true, true, false, 'generator', execaSync);243test('Can use generators with error.stdio[*] as output, objectMode, sync', testGeneratorOutput, 3, false, false, true, false, 'generator', execaSync);244test('Can use generators with result.stdio[1], noop transform, sync', testGeneratorOutput, 1, true, false, false, true, 'generator', execaSync);245test('Can use generators with result.stdout, noop transform, sync', testGeneratorOutput, 1, true, true, false, true, 'generator', execaSync);246test('Can use generators with result.stdio[2], noop transform, sync', testGeneratorOutput, 2, true, false, false, true, 'generator', execaSync);247test('Can use generators with result.stderr, noop transform, sync', testGeneratorOutput, 2, true, true, false, true, 'generator', execaSync);248test('Can use generators with result.stdio[*] as output, noop transform, sync', testGeneratorOutput, 3, true, false, false, true, 'generator', execaSync);249test('Can use generators with error.stdio[1], noop transform, sync', testGeneratorOutput, 1, false, false, false, true, 'generator', execaSync);250test('Can use generators with error.stdout, noop transform, sync', testGeneratorOutput, 1, false, true, false, true, 'generator', execaSync);251test('Can use generators with error.stdio[2], noop transform, sync', testGeneratorOutput, 2, false, false, false, true, 'generator', execaSync);252test('Can use generators with error.stderr, noop transform, sync', testGeneratorOutput, 2, false, true, false, true, 'generator', execaSync);253test('Can use generators with error.stdio[*] as output, noop transform, sync', testGeneratorOutput, 3, false, false, false, true, 'generator', execaSync);254test('Can use generators with result.stdio[1], objectMode, noop transform, sync', testGeneratorOutput, 1, true, false, true, true, 'generator', execaSync);255test('Can use generators with result.stdout, objectMode, noop transform, sync', testGeneratorOutput, 1, true, true, true, true, 'generator', execaSync);256test('Can use generators with result.stdio[2], objectMode, noop transform, sync', testGeneratorOutput, 2, true, false, true, true, 'generator', execaSync);257test('Can use generators with result.stderr, objectMode, noop transform, sync', testGeneratorOutput, 2, true, true, true, true, 'generator', execaSync);258test('Can use generators with result.stdio[*] as output, objectMode, noop transform, sync', testGeneratorOutput, 3, true, false, true, true, 'generator', execaSync);259test('Can use generators with error.stdio[1], objectMode, noop transform, sync', testGeneratorOutput, 1, false, false, true, true, 'generator', execaSync);260test('Can use generators with error.stdout, objectMode, noop transform, sync', testGeneratorOutput, 1, false, true, true, true, 'generator', execaSync);261test('Can use generators with error.stdio[2], objectMode, noop transform, sync', testGeneratorOutput, 2, false, false, true, true, 'generator', execaSync);262test('Can use generators with error.stderr, objectMode, noop transform, sync', testGeneratorOutput, 2, false, true, true, true, 'generator', execaSync);263test('Can use generators with error.stdio[*] as output, objectMode, noop transform, sync', testGeneratorOutput, 3, false, false, true, true, 'generator', execaSync);264test('Can use duplexes with result.stdio[1]', testGeneratorOutput, 1, true, false, false, false, 'duplex', execa);265test('Can use duplexes with result.stdout', testGeneratorOutput, 1, true, true, false, false, 'duplex', execa);266test('Can use duplexes with result.stdio[2]', testGeneratorOutput, 2, true, false, false, false, 'duplex', execa);267test('Can use duplexes with result.stderr', testGeneratorOutput, 2, true, true, false, false, 'duplex', execa);268test('Can use duplexes with result.stdio[*] as output', testGeneratorOutput, 3, true, false, false, false, 'duplex', execa);269test('Can use duplexes with error.stdio[1]', testGeneratorOutput, 1, false, false, false, false, 'duplex', execa);270test('Can use duplexes with error.stdout', testGeneratorOutput, 1, false, true, false, false, 'duplex', execa);271test('Can use duplexes with error.stdio[2]', testGeneratorOutput, 2, false, false, false, false, 'duplex', execa);272test('Can use duplexes with error.stderr', testGeneratorOutput, 2, false, true, false, false, 'duplex', execa);273test('Can use duplexes with error.stdio[*] as output', testGeneratorOutput, 3, false, false, false, false, 'duplex', execa);274test('Can use duplexes with result.stdio[1], objectMode', testGeneratorOutput, 1, true, false, true, false, 'duplex', execa);275test('Can use duplexes with result.stdout, objectMode', testGeneratorOutput, 1, true, true, true, false, 'duplex', execa);276test('Can use duplexes with result.stdio[2], objectMode', testGeneratorOutput, 2, true, false, true, false, 'duplex', execa);277test('Can use duplexes with result.stderr, objectMode', testGeneratorOutput, 2, true, true, true, false, 'duplex', execa);278test('Can use duplexes with result.stdio[*] as output, objectMode', testGeneratorOutput, 3, true, false, true, false, 'duplex', execa);279test('Can use duplexes with error.stdio[1], objectMode', testGeneratorOutput, 1, false, false, true, false, 'duplex', execa);280test('Can use duplexes with error.stdout, objectMode', testGeneratorOutput, 1, false, true, true, false, 'duplex', execa);281test('Can use duplexes with error.stdio[2], objectMode', testGeneratorOutput, 2, false, false, true, false, 'duplex', execa);282test('Can use duplexes with error.stderr, objectMode', testGeneratorOutput, 2, false, true, true, false, 'duplex', execa);283test('Can use duplexes with error.stdio[*] as output, objectMode', testGeneratorOutput, 3, false, false, true, false, 'duplex', execa);284test('Can use duplexes with result.stdio[1], noop transform', testGeneratorOutput, 1, true, false, false, true, 'duplex', execa);285test('Can use duplexes with result.stdout, noop transform', testGeneratorOutput, 1, true, true, false, true, 'duplex', execa);286test('Can use duplexes with result.stdio[2], noop transform', testGeneratorOutput, 2, true, false, false, true, 'duplex', execa);287test('Can use duplexes with result.stderr, noop transform', testGeneratorOutput, 2, true, true, false, true, 'duplex', execa);288test('Can use duplexes with result.stdio[*] as output, noop transform', testGeneratorOutput, 3, true, false, false, true, 'duplex', execa);289test('Can use duplexes with error.stdio[1], noop transform', testGeneratorOutput, 1, false, false, false, true, 'duplex', execa);290test('Can use duplexes with error.stdout, noop transform', testGeneratorOutput, 1, false, true, false, true, 'duplex', execa);291test('Can use duplexes with error.stdio[2], noop transform', testGeneratorOutput, 2, false, false, false, true, 'duplex', execa);292test('Can use duplexes with error.stderr, noop transform', testGeneratorOutput, 2, false, true, false, true, 'duplex', execa);293test('Can use duplexes with error.stdio[*] as output, noop transform', testGeneratorOutput, 3, false, false, false, true, 'duplex', execa);294test('Can use duplexes with result.stdio[1], objectMode, noop transform', testGeneratorOutput, 1, true, false, true, true, 'duplex', execa);295test('Can use duplexes with result.stdout, objectMode, noop transform', testGeneratorOutput, 1, true, true, true, true, 'duplex', execa);296test('Can use duplexes with result.stdio[2], objectMode, noop transform', testGeneratorOutput, 2, true, false, true, true, 'duplex', execa);297test('Can use duplexes with result.stderr, objectMode, noop transform', testGeneratorOutput, 2, true, true, true, true, 'duplex', execa);298test('Can use duplexes with result.stdio[*] as output, objectMode, noop transform', testGeneratorOutput, 3, true, false, true, true, 'duplex', execa);299test('Can use duplexes with error.stdio[1], objectMode, noop transform', testGeneratorOutput, 1, false, false, true, true, 'duplex', execa);300test('Can use duplexes with error.stdout, objectMode, noop transform', testGeneratorOutput, 1, false, true, true, true, 'duplex', execa);301test('Can use duplexes with error.stdio[2], objectMode, noop transform', testGeneratorOutput, 2, false, false, true, true, 'duplex', execa);302test('Can use duplexes with error.stderr, objectMode, noop transform', testGeneratorOutput, 2, false, true, true, true, 'duplex', execa);303test('Can use duplexes with error.stdio[*] as output, objectMode, noop transform', testGeneratorOutput, 3, false, false, true, true, 'duplex', execa);304test('Can use webTransforms with result.stdio[1]', testGeneratorOutput, 1, true, false, false, false, 'webTransform', execa);305test('Can use webTransforms with result.stdout', testGeneratorOutput, 1, true, true, false, false, 'webTransform', execa);306test('Can use webTransforms with result.stdio[2]', testGeneratorOutput, 2, true, false, false, false, 'webTransform', execa);307test('Can use webTransforms with result.stderr', testGeneratorOutput, 2, true, true, false, false, 'webTransform', execa);308test('Can use webTransforms with result.stdio[*] as output', testGeneratorOutput, 3, true, false, false, false, 'webTransform', execa);309test('Can use webTransforms with error.stdio[1]', testGeneratorOutput, 1, false, false, false, false, 'webTransform', execa);310test('Can use webTransforms with error.stdout', testGeneratorOutput, 1, false, true, false, false, 'webTransform', execa);311test('Can use webTransforms with error.stdio[2]', testGeneratorOutput, 2, false, false, false, false, 'webTransform', execa);312test('Can use webTransforms with error.stderr', testGeneratorOutput, 2, false, true, false, false, 'webTransform', execa);313test('Can use webTransforms with error.stdio[*] as output', testGeneratorOutput, 3, false, false, false, false, 'webTransform', execa);314test('Can use webTransforms with result.stdio[1], objectMode', testGeneratorOutput, 1, true, false, true, false, 'webTransform', execa);315test('Can use webTransforms with result.stdout, objectMode', testGeneratorOutput, 1, true, true, true, false, 'webTransform', execa);316test('Can use webTransforms with result.stdio[2], objectMode', testGeneratorOutput, 2, true, false, true, false, 'webTransform', execa);317test('Can use webTransforms with result.stderr, objectMode', testGeneratorOutput, 2, true, true, true, false, 'webTransform', execa);318test('Can use webTransforms with result.stdio[*] as output, objectMode', testGeneratorOutput, 3, true, false, true, false, 'webTransform', execa);319test('Can use webTransforms with error.stdio[1], objectMode', testGeneratorOutput, 1, false, false, true, false, 'webTransform', execa);320test('Can use webTransforms with error.stdout, objectMode', testGeneratorOutput, 1, false, true, true, false, 'webTransform', execa);321test('Can use webTransforms with error.stdio[2], objectMode', testGeneratorOutput, 2, false, false, true, false, 'webTransform', execa);322test('Can use webTransforms with error.stderr, objectMode', testGeneratorOutput, 2, false, true, true, false, 'webTransform', execa);323test('Can use webTransforms with error.stdio[*] as output, objectMode', testGeneratorOutput, 3, false, false, true, false, 'webTransform', execa);324test('Can use webTransforms with result.stdio[1], noop transform', testGeneratorOutput, 1, true, false, false, true, 'webTransform', execa);325test('Can use webTransforms with result.stdout, noop transform', testGeneratorOutput, 1, true, true, false, true, 'webTransform', execa);326test('Can use webTransforms with result.stdio[2], noop transform', testGeneratorOutput, 2, true, false, false, true, 'webTransform', execa);327test('Can use webTransforms with result.stderr, noop transform', testGeneratorOutput, 2, true, true, false, true, 'webTransform', execa);328test('Can use webTransforms with result.stdio[*] as output, noop transform', testGeneratorOutput, 3, true, false, false, true, 'webTransform', execa);329test('Can use webTransforms with error.stdio[1], noop transform', testGeneratorOutput, 1, false, false, false, true, 'webTransform', execa);330test('Can use webTransforms with error.stdout, noop transform', testGeneratorOutput, 1, false, true, false, true, 'webTransform', execa);331test('Can use webTransforms with error.stdio[2], noop transform', testGeneratorOutput, 2, false, false, false, true, 'webTransform', execa);332test('Can use webTransforms with error.stderr, noop transform', testGeneratorOutput, 2, false, true, false, true, 'webTransform', execa);333test('Can use webTransforms with error.stdio[*] as output, noop transform', testGeneratorOutput, 3, false, false, false, true, 'webTransform', execa);334test('Can use webTransforms with result.stdio[1], objectMode, noop transform', testGeneratorOutput, 1, true, false, true, true, 'webTransform', execa);335test('Can use webTransforms with result.stdout, objectMode, noop transform', testGeneratorOutput, 1, true, true, true, true, 'webTransform', execa);336test('Can use webTransforms with result.stdio[2], objectMode, noop transform', testGeneratorOutput, 2, true, false, true, true, 'webTransform', execa);337test('Can use webTransforms with result.stderr, objectMode, noop transform', testGeneratorOutput, 2, true, true, true, true, 'webTransform', execa);338test('Can use webTransforms with result.stdio[*] as output, objectMode, noop transform', testGeneratorOutput, 3, true, false, true, true, 'webTransform', execa);339test('Can use webTransforms with error.stdio[1], objectMode, noop transform', testGeneratorOutput, 1, false, false, true, true, 'webTransform', execa);340test('Can use webTransforms with error.stdout, objectMode, noop transform', testGeneratorOutput, 1, false, true, true, true, 'webTransform', execa);341test('Can use webTransforms with error.stdio[2], objectMode, noop transform', testGeneratorOutput, 2, false, false, true, true, 'webTransform', execa);342test('Can use webTransforms with error.stderr, objectMode, noop transform', testGeneratorOutput, 2, false, true, true, true, 'webTransform', execa);343test('Can use webTransforms with error.stdio[*] as output, objectMode, noop transform', testGeneratorOutput, 3, false, false, true, true, 'webTransform', execa);Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 344why, one step back344Improve default value of transforms `objectMode` (#867)ehmickybefore adoption8f51c6b
line 345why, one step back345// eslint-disable-next-line max-paramsAdd support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
lines 346–347why, one step back346const testGeneratorOutputPipe = async (t, fdNumber, useShortcutProperty, objectMode, addNoopTransform, type) => {347 const {generators, output, getStreamMethod} = getOutputObjectMode(objectMode, addNoopTransform, type, true);Fix strings returned by transforms in `objectMode` (#917)ehmickybefore adoption98f403c
line 348why, one step back348 const subprocess = execa('noop-fd.js', [`${fdNumber}`, foobarString], getStdio(fdNumber, generators));Rename `spawned` and `child process` to `subprocess` (#897)ehmickybefore adoption8fe2343
lines 349–350why, one step back349 const stream = useShortcutProperty ? [subprocess.stdout, subprocess.stderr][fdNumber - 1] : subprocess.stdio[fdNumber];350 const [result] = await Promise.all([getStreamMethod(stream), subprocess]);Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
line 351why, one step back351 t.deepEqual(result, output);Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
lines 352–353why, one step back352};353Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
lines 354–393why, one step back354test('Can use generators with subprocess.stdio[1]', testGeneratorOutputPipe, 1, false, false, false, 'generator');355test('Can use generators with subprocess.stdout', testGeneratorOutputPipe, 1, true, false, false, 'generator');356test('Can use generators with subprocess.stdio[2]', testGeneratorOutputPipe, 2, false, false, false, 'generator');357test('Can use generators with subprocess.stderr', testGeneratorOutputPipe, 2, true, false, false, 'generator');358test('Can use generators with subprocess.stdio[*] as output', testGeneratorOutputPipe, 3, false, false, false, 'generator');359test('Can use generators with subprocess.stdio[1], objectMode', testGeneratorOutputPipe, 1, false, true, false, 'generator');360test('Can use generators with subprocess.stdout, objectMode', testGeneratorOutputPipe, 1, true, true, false, 'generator');361test('Can use generators with subprocess.stdio[2], objectMode', testGeneratorOutputPipe, 2, false, true, false, 'generator');362test('Can use generators with subprocess.stderr, objectMode', testGeneratorOutputPipe, 2, true, true, false, 'generator');363test('Can use generators with subprocess.stdio[*] as output, objectMode', testGeneratorOutputPipe, 3, false, true, false, 'generator');364test('Can use generators with subprocess.stdio[1], noop transform', testGeneratorOutputPipe, 1, false, false, true, 'generator');365test('Can use generators with subprocess.stdout, noop transform', testGeneratorOutputPipe, 1, true, false, true, 'generator');366test('Can use generators with subprocess.stdio[2], noop transform', testGeneratorOutputPipe, 2, false, false, true, 'generator');367test('Can use generators with subprocess.stderr, noop transform', testGeneratorOutputPipe, 2, true, false, true, 'generator');368test('Can use generators with subprocess.stdio[*] as output, noop transform', testGeneratorOutputPipe, 3, false, false, true, 'generator');369test('Can use generators with subprocess.stdio[1], objectMode, noop transform', testGeneratorOutputPipe, 1, false, true, true, 'generator');370test('Can use generators with subprocess.stdout, objectMode, noop transform', testGeneratorOutputPipe, 1, true, true, true, 'generator');371test('Can use generators with subprocess.stdio[2], objectMode, noop transform', testGeneratorOutputPipe, 2, false, true, true, 'generator');372test('Can use generators with subprocess.stderr, objectMode, noop transform', testGeneratorOutputPipe, 2, true, true, true, 'generator');373test('Can use generators with subprocess.stdio[*] as output, objectMode, noop transform', testGeneratorOutputPipe, 3, false, true, true, 'generator');374test('Can use duplexes with subprocess.stdio[1]', testGeneratorOutputPipe, 1, false, false, false, 'duplex');375test('Can use duplexes with subprocess.stdout', testGeneratorOutputPipe, 1, true, false, false, 'duplex');376test('Can use duplexes with subprocess.stdio[2]', testGeneratorOutputPipe, 2, false, false, false, 'duplex');377test('Can use duplexes with subprocess.stderr', testGeneratorOutputPipe, 2, true, false, false, 'duplex');378test('Can use duplexes with subprocess.stdio[*] as output', testGeneratorOutputPipe, 3, false, false, false, 'duplex');379test('Can use duplexes with subprocess.stdio[1], objectMode', testGeneratorOutputPipe, 1, false, true, false, 'duplex');380test('Can use duplexes with subprocess.stdout, objectMode', testGeneratorOutputPipe, 1, true, true, false, 'duplex');381test('Can use duplexes with subprocess.stdio[2], objectMode', testGeneratorOutputPipe, 2, false, true, false, 'duplex');382test('Can use duplexes with subprocess.stderr, objectMode', testGeneratorOutputPipe, 2, true, true, false, 'duplex');383test('Can use duplexes with subprocess.stdio[*] as output, objectMode', testGeneratorOutputPipe, 3, false, true, false, 'duplex');384test('Can use duplexes with subprocess.stdio[1], noop transform', testGeneratorOutputPipe, 1, false, false, true, 'duplex');385test('Can use duplexes with subprocess.stdout, noop transform', testGeneratorOutputPipe, 1, true, false, true, 'duplex');386test('Can use duplexes with subprocess.stdio[2], noop transform', testGeneratorOutputPipe, 2, false, false, true, 'duplex');387test('Can use duplexes with subprocess.stderr, noop transform', testGeneratorOutputPipe, 2, true, false, true, 'duplex');388test('Can use duplexes with subprocess.stdio[*] as output, noop transform', testGeneratorOutputPipe, 3, false, false, true, 'duplex');389test('Can use duplexes with subprocess.stdio[1], objectMode, noop transform', testGeneratorOutputPipe, 1, false, true, true, 'duplex');390test('Can use duplexes with subprocess.stdout, objectMode, noop transform', testGeneratorOutputPipe, 1, true, true, true, 'duplex');391test('Can use duplexes with subprocess.stdio[2], objectMode, noop transform', testGeneratorOutputPipe, 2, false, true, true, 'duplex');392test('Can use duplexes with subprocess.stderr, objectMode, noop transform', testGeneratorOutputPipe, 2, true, true, true, 'duplex');393test('Can use duplexes with subprocess.stdio[*] as output, objectMode, noop transform', testGeneratorOutputPipe, 3, false, true, true, 'duplex');Add support for `std*: TransformStream` option (#938)ehmickybefore adoption45824d6
lines 394–413why, one step back394test('Can use webTransforms with subprocess.stdio[1]', testGeneratorOutputPipe, 1, false, false, false, 'webTransform');395test('Can use webTransforms with subprocess.stdout', testGeneratorOutputPipe, 1, true, false, false, 'webTransform');396test('Can use webTransforms with subprocess.stdio[2]', testGeneratorOutputPipe, 2, false, false, false, 'webTransform');397test('Can use webTransforms with subprocess.stderr', testGeneratorOutputPipe, 2, true, false, false, 'webTransform');398test('Can use webTransforms with subprocess.stdio[*] as output', testGeneratorOutputPipe, 3, false, false, false, 'webTransform');399test('Can use webTransforms with subprocess.stdio[1], objectMode', testGeneratorOutputPipe, 1, false, true, false, 'webTransform');400test('Can use webTransforms with subprocess.stdout, objectMode', testGeneratorOutputPipe, 1, true, true, false, 'webTransform');401test('Can use webTransforms with subprocess.stdio[2], objectMode', testGeneratorOutputPipe, 2, false, true, false, 'webTransform');402test('Can use webTransforms with subprocess.stderr, objectMode', testGeneratorOutputPipe, 2, true, true, false, 'webTransform');403test('Can use webTransforms with subprocess.stdio[*] as output, objectMode', testGeneratorOutputPipe, 3, false, true, false, 'webTransform');404test('Can use webTransforms with subprocess.stdio[1], noop transform', testGeneratorOutputPipe, 1, false, false, true, 'webTransform');405test('Can use webTransforms with subprocess.stdout, noop transform', testGeneratorOutputPipe, 1, true, false, true, 'webTransform');406test('Can use webTransforms with subprocess.stdio[2], noop transform', testGeneratorOutputPipe, 2, false, false, true, 'webTransform');407test('Can use webTransforms with subprocess.stderr, noop transform', testGeneratorOutputPipe, 2, true, false, true, 'webTransform');408test('Can use webTransforms with subprocess.stdio[*] as output, noop transform', testGeneratorOutputPipe, 3, false, false, true, 'webTransform');409test('Can use webTransforms with subprocess.stdio[1], objectMode, noop transform', testGeneratorOutputPipe, 1, false, true, true, 'webTransform');410test('Can use webTransforms with subprocess.stdout, objectMode, noop transform', testGeneratorOutputPipe, 1, true, true, true, 'webTransform');411test('Can use webTransforms with subprocess.stdio[2], objectMode, noop transform', testGeneratorOutputPipe, 2, false, true, true, 'webTransform');412test('Can use webTransforms with subprocess.stderr, objectMode, noop transform', testGeneratorOutputPipe, 2, true, true, true, 'webTransform');413test('Can use webTransforms with subprocess.stdio[*] as output, objectMode, noop transform', testGeneratorOutputPipe, 3, false, true, true, 'webTransform');Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 414why, one step back414Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
lines 415–420why, one step back415const getAllStdioOption = (stdioOption, encoding, objectMode) => {416 if (stdioOption) {417 return 'pipe';418 }419420 if (objectMode) {Refactor tests (#934)ehmickybefore adoption52c4bde
line 421why, one step back421 return outputObjectGenerator();Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
lines 422–423why, one step back422 }423Refactor tests (#934)ehmickybefore adoption52c4bde
line 424why, one step back424 return encoding === 'utf8' ? uppercaseGenerator() : uppercaseBufferGenerator();Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
lines 425–426why, one step back425};426Fix `lines` option (#957)ehmickybefore adoption15ab4e6
line 427why, one step back427const getStdoutStderrOutput = ({output, stdioOption, encoding, objectMode, lines}) => {Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
line 428why, one step back428 if (objectMode && !stdioOption) {Fix `lines` option (#957)ehmickybefore adoption15ab4e6
line 429why, one step back429 return encoding === 'utf8' ? [foobarObject, foobarObject] : [foobarObject];Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
lines 430–432why, one step back430 }431432 const stdioOutput = stdioOption ? output : output.toUpperCase();Improve handling of `encoding` option (#926)ehmickybefore adoptiond786fcf
lines 433–437why, one step back433434 if (encoding === 'hex') {435 return Buffer.from(stdioOutput).toString('hex');436 }437Fix `lines` option (#957)ehmickybefore adoption15ab4e6
lines 438–442why, one step back438 if (encoding === 'buffer') {439 return textEncoder.encode(stdioOutput);440 }441442 return lines ? stdioOutput.trim().split('\n').map(string => `${string}\n`) : stdioOutput;Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
lines 443–444why, one step back443};444Fix `lines` option (#957)ehmickybefore adoption15ab4e6
lines 445–446why, one step back445const getAllOutput = ({stdoutOutput, stderrOutput, encoding, objectMode, lines}) => {446 if (objectMode || (lines && encoding === 'utf8')) {Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
lines 447–455why, one step back447 return [stdoutOutput, stderrOutput].flat();448 }449450 return encoding === 'buffer'451 ? new Uint8Array([...stdoutOutput, ...stderrOutput])452 : `${stdoutOutput}${stderrOutput}`;453};454455// eslint-disable-next-line max-paramsFix `lines` option (#957)ehmickybefore adoption15ab4e6
line 456why, one step back456const testGeneratorAll = async (t, reject, encoding, objectMode, stdoutOption, stderrOption, lines, execaMethod) => {Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 457why, one step back457 const fixtureName = reject ? 'all.js' : 'all-fail.js';Add support for `all` option to `execaSync()` (#956)ehmickybefore adoption63b5ac4
line 458why, one step back458 const {stdout, stderr, all} = await execaMethod(fixtureName, {Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
lines 459–463why, one step back459 all: true,460 reject,461 stdout: getAllStdioOption(stdoutOption, encoding, objectMode),462 stderr: getAllStdioOption(stderrOption, encoding, objectMode),463 encoding,Fix `lines` option (#957)ehmickybefore adoption15ab4e6
line 464why, one step back464 lines,Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
lines 465–467why, one step back465 stripFinalNewline: false,466 });467Fix `lines` option (#957)ehmickybefore adoption15ab4e6
line 468why, one step back468 const stdoutOutput = getStdoutStderrOutput({output: 'std\nout\n', stdioOption: stdoutOption, encoding, objectMode, lines});Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
line 469why, one step back469 t.deepEqual(stdout, stdoutOutput);Fix `lines` option (#957)ehmickybefore adoption15ab4e6
line 470why, one step back470 const stderrOutput = getStdoutStderrOutput({output: 'std\nerr\n', stdioOption: stderrOption, encoding, objectMode, lines});Allow any type with transforms (#709)ehmickybefore adoptioned8b2ce
line 471why, one step back471 t.deepEqual(stderr, stderrOutput);Fix `lines` option (#957)ehmickybefore adoption15ab4e6
lines 472–477why, one step back472 const allOutput = getAllOutput({stdoutOutput, stderrOutput, encoding, objectMode, lines});473 if (Array.isArray(all) && Array.isArray(allOutput)) {474 t.deepEqual([...all].sort(), [...allOutput].sort());475 } else {476 t.deepEqual(all, allOutput);477 }Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
lines 478–479why, one step back478};479Fix `lines` option (#957)ehmickybefore adoption15ab4e6
lines 480–623why, one step back480test('Can use generators with result.all = transform + transform', testGeneratorAll, true, 'utf8', false, false, false, false, execa);481test('Can use generators with error.all = transform + transform', testGeneratorAll, false, 'utf8', false, false, false, false, execa);482test('Can use generators with result.all = transform + transform, encoding "buffer"', testGeneratorAll, true, 'buffer', false, false, false, false, execa);483test('Can use generators with error.all = transform + transform, encoding "buffer"', testGeneratorAll, false, 'buffer', false, false, false, false, execa);484test('Can use generators with result.all = transform + transform, encoding "hex"', testGeneratorAll, true, 'hex', false, false, false, false, execa);485test('Can use generators with error.all = transform + transform, encoding "hex"', testGeneratorAll, false, 'hex', false, false, false, false, execa);486test('Can use generators with result.all = transform + pipe', testGeneratorAll, true, 'utf8', false, false, true, false, execa);487test('Can use generators with error.all = transform + pipe', testGeneratorAll, false, 'utf8', false, false, true, false, execa);488test('Can use generators with result.all = transform + pipe, encoding "buffer"', testGeneratorAll, true, 'buffer', false, false, true, false, execa);489test('Can use generators with error.all = transform + pipe, encoding "buffer"', testGeneratorAll, false, 'buffer', false, false, true, false, execa);490test('Can use generators with result.all = transform + pipe, encoding "hex"', testGeneratorAll, true, 'hex', false, false, true, false, execa);491test('Can use generators with error.all = transform + pipe, encoding "hex"', testGeneratorAll, false, 'hex', false, false, true, false, execa);492test('Can use generators with result.all = pipe + transform', testGeneratorAll, true, 'utf8', false, true, false, false, execa);493test('Can use generators with error.all = pipe + transform', testGeneratorAll, false, 'utf8', false, true, false, false, execa);494test('Can use generators with result.all = pipe + transform, encoding "buffer"', testGeneratorAll, true, 'buffer', false, true, false, false, execa);495test('Can use generators with error.all = pipe + transform, encoding "buffer"', testGeneratorAll, false, 'buffer', false, true, false, false, execa);496test('Can use generators with result.all = pipe + transform, encoding "hex"', testGeneratorAll, true, 'hex', false, true, false, false, execa);497test('Can use generators with error.all = pipe + transform, encoding "hex"', testGeneratorAll, false, 'hex', false, true, false, false, execa);498test('Can use generators with result.all = transform + transform, objectMode', testGeneratorAll, true, 'utf8', true, false, false, false, execa);499test('Can use generators with error.all = transform + transform, objectMode', testGeneratorAll, false, 'utf8', true, false, false, false, execa);500test('Can use generators with result.all = transform + transform, objectMode, encoding "buffer"', testGeneratorAll, true, 'buffer', true, false, false, false, execa);501test('Can use generators with error.all = transform + transform, objectMode, encoding "buffer"', testGeneratorAll, false, 'buffer', true, false, false, false, execa);502test('Can use generators with result.all = transform + transform, objectMode, encoding "hex"', testGeneratorAll, true, 'hex', true, false, false, false, execa);503test('Can use generators with error.all = transform + transform, objectMode, encoding "hex"', testGeneratorAll, false, 'hex', true, false, false, false, execa);504test('Can use generators with result.all = transform + pipe, objectMode', testGeneratorAll, true, 'utf8', true, false, true, false, execa);505test('Can use generators with error.all = transform + pipe, objectMode', testGeneratorAll, false, 'utf8', true, false, true, false, execa);506test('Can use generators with result.all = transform + pipe, objectMode, encoding "buffer"', testGeneratorAll, true, 'buffer', true, false, true, false, execa);507test('Can use generators with error.all = transform + pipe, objectMode, encoding "buffer"', testGeneratorAll, false, 'buffer', true, false, true, false, execa);508test('Can use generators with result.all = transform + pipe, objectMode, encoding "hex"', testGeneratorAll, true, 'hex', true, false, true, false, execa);509test('Can use generators with error.all = transform + pipe, objectMode, encoding "hex"', testGeneratorAll, false, 'hex', true, false, true, false, execa);510test('Can use generators with result.all = pipe + transform, objectMode', testGeneratorAll, true, 'utf8', true, true, false, false, execa);511test('Can use generators with error.all = pipe + transform, objectMode', testGeneratorAll, false, 'utf8', true, true, false, false, execa);512test('Can use generators with result.all = pipe + transform, objectMode, encoding "buffer"', testGeneratorAll, true, 'buffer', true, true, false, false, execa);513test('Can use generators with error.all = pipe + transform, objectMode, encoding "buffer"', testGeneratorAll, false, 'buffer', true, true, false, false, execa);514test('Can use generators with result.all = pipe + transform, objectMode, encoding "hex"', testGeneratorAll, true, 'hex', true, true, false, false, execa);515test('Can use generators with error.all = pipe + transform, objectMode, encoding "hex"', testGeneratorAll, false, 'hex', true, true, false, false, execa);516test('Can use generators with result.all = transform + transform, sync', testGeneratorAll, true, 'utf8', false, false, false, false, execaSync);517test('Can use generators with error.all = transform + transform, sync', testGeneratorAll, false, 'utf8', false, false, false, false, execaSync);518test('Can use generators with result.all = transform + transform, encoding "buffer", sync', testGeneratorAll, true, 'buffer', false, false, false, false, execaSync);519test('Can use generators with error.all = transform + transform, encoding "buffer", sync', testGeneratorAll, false, 'buffer', false, false, false, false, execaSync);520test('Can use generators with result.all = transform + transform, encoding "hex", sync', testGeneratorAll, true, 'hex', false, false, false, false, execaSync);521test('Can use generators with error.all = transform + transform, encoding "hex", sync', testGeneratorAll, false, 'hex', false, false, false, false, execaSync);522test('Can use generators with result.all = transform + pipe, sync', testGeneratorAll, true, 'utf8', false, false, true, false, execaSync);523test('Can use generators with error.all = transform + pipe, sync', testGeneratorAll, false, 'utf8', false, false, true, false, execaSync);524test('Can use generators with result.all = transform + pipe, encoding "buffer", sync', testGeneratorAll, true, 'buffer', false, false, true, false, execaSync);525test('Can use generators with error.all = transform + pipe, encoding "buffer", sync', testGeneratorAll, false, 'buffer', false, false, true, false, execaSync);526test('Can use generators with result.all = transform + pipe, encoding "hex", sync', testGeneratorAll, true, 'hex', false, false, true, false, execaSync);527test('Can use generators with error.all = transform + pipe, encoding "hex", sync', testGeneratorAll, false, 'hex', false, false, true, false, execaSync);528test('Can use generators with result.all = pipe + transform, sync', testGeneratorAll, true, 'utf8', false, true, false, false, execaSync);529test('Can use generators with error.all = pipe + transform, sync', testGeneratorAll, false, 'utf8', false, true, false, false, execaSync);530test('Can use generators with result.all = pipe + transform, encoding "buffer", sync', testGeneratorAll, true, 'buffer', false, true, false, false, execaSync);531test('Can use generators with error.all = pipe + transform, encoding "buffer", sync', testGeneratorAll, false, 'buffer', false, true, false, false, execaSync);532test('Can use generators with result.all = pipe + transform, encoding "hex", sync', testGeneratorAll, true, 'hex', false, true, false, false, execaSync);533test('Can use generators with error.all = pipe + transform, encoding "hex", sync', testGeneratorAll, false, 'hex', false, true, false, false, execaSync);534test('Can use generators with result.all = transform + transform, objectMode, sync', testGeneratorAll, true, 'utf8', true, false, false, false, execaSync);535test('Can use generators with error.all = transform + transform, objectMode, sync', testGeneratorAll, false, 'utf8', true, false, false, false, execaSync);536test('Can use generators with result.all = transform + transform, objectMode, encoding "buffer", sync', testGeneratorAll, true, 'buffer', true, false, false, false, execaSync);537test('Can use generators with error.all = transform + transform, objectMode, encoding "buffer", sync', testGeneratorAll, false, 'buffer', true, false, false, false, execaSync);538test('Can use generators with result.all = transform + transform, objectMode, encoding "hex", sync', testGeneratorAll, true, 'hex', true, false, false, false, execaSync);539test('Can use generators with error.all = transform + transform, objectMode, encoding "hex", sync', testGeneratorAll, false, 'hex', true, false, false, false, execaSync);540test('Can use generators with result.all = transform + pipe, objectMode, sync', testGeneratorAll, true, 'utf8', true, false, true, false, execaSync);541test('Can use generators with error.all = transform + pipe, objectMode, sync', testGeneratorAll, false, 'utf8', true, false, true, false, execaSync);542test('Can use generators with result.all = transform + pipe, objectMode, encoding "buffer", sync', testGeneratorAll, true, 'buffer', true, false, true, false, execaSync);543test('Can use generators with error.all = transform + pipe, objectMode, encoding "buffer", sync', testGeneratorAll, false, 'buffer', true, false, true, false, execaSync);544test('Can use generators with result.all = transform + pipe, objectMode, encoding "hex", sync', testGeneratorAll, true, 'hex', true, false, true, false, execaSync);545test('Can use generators with error.all = transform + pipe, objectMode, encoding "hex", sync', testGeneratorAll, false, 'hex', true, false, true, false, execaSync);546test('Can use generators with result.all = pipe + transform, objectMode, sync', testGeneratorAll, true, 'utf8', true, true, false, false, execaSync);547test('Can use generators with error.all = pipe + transform, objectMode, sync', testGeneratorAll, false, 'utf8', true, true, false, false, execaSync);548test('Can use generators with result.all = pipe + transform, objectMode, encoding "buffer", sync', testGeneratorAll, true, 'buffer', true, true, false, false, execaSync);549test('Can use generators with error.all = pipe + transform, objectMode, encoding "buffer", sync', testGeneratorAll, false, 'buffer', true, true, false, false, execaSync);550test('Can use generators with result.all = pipe + transform, objectMode, encoding "hex", sync', testGeneratorAll, true, 'hex', true, true, false, false, execaSync);551test('Can use generators with error.all = pipe + transform, objectMode, encoding "hex", sync', testGeneratorAll, false, 'hex', true, true, false, false, execaSync);552test('Can use generators with result.all = transform + transform, lines', testGeneratorAll, true, 'utf8', false, false, false, true, execa);553test('Can use generators with error.all = transform + transform, lines', testGeneratorAll, false, 'utf8', false, false, false, true, execa);554test('Can use generators with result.all = transform + transform, encoding "buffer", lines', testGeneratorAll, true, 'buffer', false, false, false, true, execa);555test('Can use generators with error.all = transform + transform, encoding "buffer", lines', testGeneratorAll, false, 'buffer', false, false, false, true, execa);556test('Can use generators with result.all = transform + transform, encoding "hex", lines', testGeneratorAll, true, 'hex', false, false, false, true, execa);557test('Can use generators with error.all = transform + transform, encoding "hex", lines', testGeneratorAll, false, 'hex', false, false, false, true, execa);558test('Can use generators with result.all = transform + pipe, lines', testGeneratorAll, true, 'utf8', false, false, true, true, execa);559test('Can use generators with error.all = transform + pipe, lines', testGeneratorAll, false, 'utf8', false, false, true, true, execa);560test('Can use generators with result.all = transform + pipe, encoding "buffer", lines', testGeneratorAll, true, 'buffer', false, false, true, true, execa);561test('Can use generators with error.all = transform + pipe, encoding "buffer", lines', testGeneratorAll, false, 'buffer', false, false, true, true, execa);562test('Can use generators with result.all = transform + pipe, encoding "hex", lines', testGeneratorAll, true, 'hex', false, false, true, true, execa);563test('Can use generators with error.all = transform + pipe, encoding "hex", lines', testGeneratorAll, false, 'hex', false, false, true, true, execa);564test('Can use generators with result.all = pipe + transform, lines', testGeneratorAll, true, 'utf8', false, true, false, true, execa);565test('Can use generators with error.all = pipe + transform, lines', testGeneratorAll, false, 'utf8', false, true, false, true, execa);566test('Can use generators with result.all = pipe + transform, encoding "buffer", lines', testGeneratorAll, true, 'buffer', false, true, false, true, execa);567test('Can use generators with error.all = pipe + transform, encoding "buffer", lines', testGeneratorAll, false, 'buffer', false, true, false, true, execa);568test('Can use generators with result.all = pipe + transform, encoding "hex", lines', testGeneratorAll, true, 'hex', false, true, false, true, execa);569test('Can use generators with error.all = pipe + transform, encoding "hex", lines', testGeneratorAll, false, 'hex', false, true, false, true, execa);570test('Can use generators with result.all = transform + transform, objectMode, lines', testGeneratorAll, true, 'utf8', true, false, false, true, execa);571test('Can use generators with error.all = transform + transform, objectMode, lines', testGeneratorAll, false, 'utf8', true, false, false, true, execa);572test('Can use generators with result.all = transform + transform, objectMode, encoding "buffer", lines', testGeneratorAll, true, 'buffer', true, false, false, true, execa);573test('Can use generators with error.all = transform + transform, objectMode, encoding "buffer", lines', testGeneratorAll, false, 'buffer', true, false, false, true, execa);574test('Can use generators with result.all = transform + transform, objectMode, encoding "hex", lines', testGeneratorAll, true, 'hex', true, false, false, true, execa);575test('Can use generators with error.all = transform + transform, objectMode, encoding "hex", lines', testGeneratorAll, false, 'hex', true, false, false, true, execa);576test('Can use generators with result.all = transform + pipe, objectMode, lines', testGeneratorAll, true, 'utf8', true, false, true, true, execa);577test('Can use generators with error.all = transform + pipe, objectMode, lines', testGeneratorAll, false, 'utf8', true, false, true, true, execa);578test('Can use generators with result.all = transform + pipe, objectMode, encoding "buffer", lines', testGeneratorAll, true, 'buffer', true, false, true, true, execa);579test('Can use generators with error.all = transform + pipe, objectMode, encoding "buffer", lines', testGeneratorAll, false, 'buffer', true, false, true, true, execa);580test('Can use generators with result.all = transform + pipe, objectMode, encoding "hex", lines', testGeneratorAll, true, 'hex', true, false, true, true, execa);581test('Can use generators with error.all = transform + pipe, objectMode, encoding "hex", lines', testGeneratorAll, false, 'hex', true, false, true, true, execa);582test('Can use generators with result.all = pipe + transform, objectMode, lines', testGeneratorAll, true, 'utf8', true, true, false, true, execa);583test('Can use generators with error.all = pipe + transform, objectMode, lines', testGeneratorAll, false, 'utf8', true, true, false, true, execa);584test('Can use generators with result.all = pipe + transform, objectMode, encoding "buffer", lines', testGeneratorAll, true, 'buffer', true, true, false, true, execa);585test('Can use generators with error.all = pipe + transform, objectMode, encoding "buffer", lines', testGeneratorAll, false, 'buffer', true, true, false, true, execa);586test('Can use generators with result.all = pipe + transform, objectMode, encoding "hex", lines', testGeneratorAll, true, 'hex', true, true, false, true, execa);587test('Can use generators with error.all = pipe + transform, objectMode, encoding "hex", lines', testGeneratorAll, false, 'hex', true, true, false, true, execa);588test('Can use generators with result.all = transform + transform, sync, lines', testGeneratorAll, true, 'utf8', false, false, false, true, execaSync);589test('Can use generators with error.all = transform + transform, sync, lines', testGeneratorAll, false, 'utf8', false, false, false, true, execaSync);590test('Can use generators with result.all = transform + transform, encoding "buffer", sync, lines', testGeneratorAll, true, 'buffer', false, false, false, true, execaSync);591test('Can use generators with error.all = transform + transform, encoding "buffer", sync, lines', testGeneratorAll, false, 'buffer', false, false, false, true, execaSync);592test('Can use generators with result.all = transform + transform, encoding "hex", sync, lines', testGeneratorAll, true, 'hex', false, false, false, true, execaSync);593test('Can use generators with error.all = transform + transform, encoding "hex", sync, lines', testGeneratorAll, false, 'hex', false, false, false, true, execaSync);594test('Can use generators with result.all = transform + pipe, sync, lines', testGeneratorAll, true, 'utf8', false, false, true, true, execaSync);595test('Can use generators with error.all = transform + pipe, sync, lines', testGeneratorAll, false, 'utf8', false, false, true, true, execaSync);596test('Can use generators with result.all = transform + pipe, encoding "buffer", sync, lines', testGeneratorAll, true, 'buffer', false, false, true, true, execaSync);597test('Can use generators with error.all = transform + pipe, encoding "buffer", sync, lines', testGeneratorAll, false, 'buffer', false, false, true, true, execaSync);598test('Can use generators with result.all = transform + pipe, encoding "hex", sync, lines', testGeneratorAll, true, 'hex', false, false, true, true, execaSync);599test('Can use generators with error.all = transform + pipe, encoding "hex", sync, lines', testGeneratorAll, false, 'hex', false, false, true, true, execaSync);600test('Can use generators with result.all = pipe + transform, sync, lines', testGeneratorAll, true, 'utf8', false, true, false, true, execaSync);601test('Can use generators with error.all = pipe + transform, sync, lines', testGeneratorAll, false, 'utf8', false, true, false, true, execaSync);602test('Can use generators with result.all = pipe + transform, encoding "buffer", sync, lines', testGeneratorAll, true, 'buffer', false, true, false, true, execaSync);603test('Can use generators with error.all = pipe + transform, encoding "buffer", sync, lines', testGeneratorAll, false, 'buffer', false, true, false, true, execaSync);604test('Can use generators with result.all = pipe + transform, encoding "hex", sync, lines', testGeneratorAll, true, 'hex', false, true, false, true, execaSync);605test('Can use generators with error.all = pipe + transform, encoding "hex", sync, lines', testGeneratorAll, false, 'hex', false, true, false, true, execaSync);606test('Can use generators with result.all = transform + transform, objectMode, sync, lines', testGeneratorAll, true, 'utf8', true, false, false, true, execaSync);607test('Can use generators with error.all = transform + transform, objectMode, sync, lines', testGeneratorAll, false, 'utf8', true, false, false, true, execaSync);608test('Can use generators with result.all = transform + transform, objectMode, encoding "buffer", sync, lines', testGeneratorAll, true, 'buffer', true, false, false, true, execaSync);609test('Can use generators with error.all = transform + transform, objectMode, encoding "buffer", sync, lines', testGeneratorAll, false, 'buffer', true, false, false, true, execaSync);610test('Can use generators with result.all = transform + transform, objectMode, encoding "hex", sync, lines', testGeneratorAll, true, 'hex', true, false, false, true, execaSync);611test('Can use generators with error.all = transform + transform, objectMode, encoding "hex", sync, lines', testGeneratorAll, false, 'hex', true, false, false, true, execaSync);612test('Can use generators with result.all = transform + pipe, objectMode, sync, lines', testGeneratorAll, true, 'utf8', true, false, true, true, execaSync);613test('Can use generators with error.all = transform + pipe, objectMode, sync, lines', testGeneratorAll, false, 'utf8', true, false, true, true, execaSync);614test('Can use generators with result.all = transform + pipe, objectMode, encoding "buffer", sync, lines', testGeneratorAll, true, 'buffer', true, false, true, true, execaSync);615test('Can use generators with error.all = transform + pipe, objectMode, encoding "buffer", sync, lines', testGeneratorAll, false, 'buffer', true, false, true, true, execaSync);616test('Can use generators with result.all = transform + pipe, objectMode, encoding "hex", sync, lines', testGeneratorAll, true, 'hex', true, false, true, true, execaSync);617test('Can use generators with error.all = transform + pipe, objectMode, encoding "hex", sync, lines', testGeneratorAll, false, 'hex', true, false, true, true, execaSync);618test('Can use generators with result.all = pipe + transform, objectMode, sync, lines', testGeneratorAll, true, 'utf8', true, true, false, true, execaSync);619test('Can use generators with error.all = pipe + transform, objectMode, sync, lines', testGeneratorAll, false, 'utf8', true, true, false, true, execaSync);620test('Can use generators with result.all = pipe + transform, objectMode, encoding "buffer", sync, lines', testGeneratorAll, true, 'buffer', true, true, false, true, execaSync);621test('Can use generators with error.all = pipe + transform, objectMode, encoding "buffer", sync, lines', testGeneratorAll, false, 'buffer', true, true, false, true, execaSync);622test('Can use generators with result.all = pipe + transform, objectMode, encoding "hex", sync, lines', testGeneratorAll, true, 'hex', true, true, false, true, execaSync);623test('Can use generators with error.all = pipe + transform, objectMode, encoding "hex", sync, lines', testGeneratorAll, false, 'hex', true, true, false, true, execaSync);Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 624why, one step back624Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
lines 625–626why, one step back625const testInputOption = async (t, type, execaMethod) => {626 const {stdout} = await execaMethod('stdin-fd.js', ['0'], {stdin: generatorsMap[type].uppercase(), input: foobarUint8Array});Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 627why, one step back627 t.is(stdout, foobarUppercase);Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 628why, one step back628};Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 629why, one step back629Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
lines 630–633why, one step back630test('Can use generators with input option', testInputOption, 'generator', execa);631test('Can use generators with input option, sync', testInputOption, 'generator', execaSync);632test('Can use duplexes with input option', testInputOption, 'duplex', execa);633test('Can use webTransforms with input option', testInputOption, 'webTransform', execa);Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 634why, one step back634Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
lines 635–636why, one step back635// eslint-disable-next-line max-params636const testInputFile = async (t, stdinOption, useInputFile, reversed, execaMethod) => {Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
lines 637–638why, one step back637 const filePath = tempfile();638 await writeFile(filePath, foobarString);Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
lines 639–643why, one step back639 const options = useInputFile640 ? {inputFile: filePath, stdin: stdinOption}641 : {stdin: [{file: filePath}, stdinOption]};642 options.stdin = reversed ? options.stdin.reverse() : options.stdin;643 const {stdout} = await execaMethod('stdin-fd.js', ['0'], options);Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
lines 644–647why, one step back644 t.is(stdout, foobarUppercase);645 await rm(filePath);646};647Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
lines 648–659why, one step back648test('Can use generators with a file as input', testInputFile, uppercaseGenerator(), false, false, execa);649test('Can use generators with a file as input, reversed', testInputFile, uppercaseGenerator(), false, true, execa);650test('Can use generators with inputFile option', testInputFile, uppercaseGenerator(), true, false, execa);651test('Can use generators with a file as input, sync', testInputFile, uppercaseGenerator(), false, false, execaSync);652test('Can use generators with a file as input, reversed, sync', testInputFile, uppercaseGenerator(), false, true, execaSync);653test('Can use generators with inputFile option, sync', testInputFile, uppercaseGenerator(), true, false, execaSync);654test('Can use duplexes with a file as input', testInputFile, uppercaseBufferDuplex(), false, false, execa);655test('Can use duplexes with a file as input, reversed', testInputFile, uppercaseBufferDuplex(), false, true, execa);656test('Can use duplexes with inputFile option', testInputFile, uppercaseBufferDuplex(), true, false, execa);657test('Can use webTransforms with a file as input', testInputFile, uppercaseBufferWebTransform(), false, false, execa);658test('Can use webTransforms with a file as input, reversed', testInputFile, uppercaseBufferWebTransform(), false, true, execa);659test('Can use webTransforms with inputFile option', testInputFile, uppercaseBufferWebTransform(), true, false, execa);Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 660why, one step back660Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
line 661why, one step back661const testOutputFile = async (t, reversed, type, execaMethod) => {Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 662why, one step back662 const filePath = tempfile();Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 663why, one step back663 const stdoutOption = [generatorsMap[type].uppercaseBuffer(false, true), {file: filePath}];Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 664why, one step back664 const reversedStdoutOption = reversed ? stdoutOption.reverse() : stdoutOption;Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
line 665why, one step back665 const {stdout} = await execaMethod('noop-fd.js', ['1'], {stdout: reversedStdoutOption});Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
lines 666–670why, one step back666 t.is(stdout, foobarUppercase);667 t.is(await readFile(filePath, 'utf8'), foobarUppercase);668 await rm(filePath);669};670Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
lines 671–678why, one step back671test('Can use generators with a file as output', testOutputFile, false, 'generator', execa);672test('Can use generators with a file as output, reversed', testOutputFile, true, 'generator', execa);673test('Can use generators with a file as output, sync', testOutputFile, false, 'generator', execaSync);674test('Can use generators with a file as output, reversed, sync', testOutputFile, true, 'generator', execaSync);675test('Can use duplexes with a file as output', testOutputFile, false, 'duplex', execa);676test('Can use duplexes with a file as output, reversed', testOutputFile, true, 'duplex', execa);677test('Can use webTransforms with a file as output', testOutputFile, false, 'webTransform', execa);678test('Can use webTransforms with a file as output, reversed', testOutputFile, true, 'webTransform', execa);Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 679why, one step back679Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 680why, one step back680const testWritableDestination = async (t, type) => {Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
lines 681–682why, one step back681 const passThrough = new PassThrough();682 const [{stdout}, streamOutput] = await Promise.all([Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 683why, one step back683 execa('noop-fd.js', ['1', foobarString], {stdout: [generatorsMap[type].uppercaseBuffer(false, true), passThrough]}),Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
lines 684–687why, one step back684 getStream(passThrough),685 ]);686 t.is(stdout, foobarUppercase);687 t.is(streamOutput, foobarUppercase);Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 688why, one step back688};Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 689why, one step back689Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
lines 690–691why, one step back690test('Can use generators to a Writable stream', testWritableDestination, 'generator');691test('Can use duplexes to a Writable stream', testWritableDestination, 'duplex');Add support for `std*: TransformStream` option (#938)ehmickybefore adoption45824d6
line 692why, one step back692test('Can use webTransforms to a Writable stream', testWritableDestination, 'webTransform');Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
lines 693–694why, one step back693694const testReadableSource = async (t, type) => {Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 695why, one step back695 const passThrough = new PassThrough();Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 696why, one step back696 const subprocess = execa('stdin-fd.js', ['0'], {stdin: [passThrough, generatorsMap[type].uppercase()]});Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 697why, one step back697 passThrough.end(foobarString);Rename `spawned` and `child process` to `subprocess` (#897)ehmickybefore adoption8fe2343
line 698why, one step back698 const {stdout} = await subprocess;Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 699why, one step back699 t.is(stdout, foobarUppercase);Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 700why, one step back700};Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 701why, one step back701Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
lines 702–703why, one step back702test('Can use generators from a Readable stream', testReadableSource, 'generator');703test('Can use duplexes from a Readable stream', testReadableSource, 'duplex');Add support for `std*: TransformStream` option (#938)ehmickybefore adoption45824d6
line 704why, one step back704test('Can use webTransforms from a Readable stream', testReadableSource, 'webTransform');Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
lines 705–707why, one step back705706const testInherit = async (t, type) => {707 const {stdout} = await execa('nested-inherit.js', [type]);Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 708why, one step back708 t.is(stdout, foobarUppercase);Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 709why, one step back709};Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 710why, one step back710Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
lines 711–712why, one step back711test('Can use generators with "inherit"', testInherit, 'generator');712test('Can use duplexes with "inherit"', testInherit, 'duplex');Add support for `std*: TransformStream` option (#938)ehmickybefore adoption45824d6
line 713why, one step back713test('Can use webTransforms with "inherit"', testInherit, 'webTransform');Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 714why, one step back714Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
line 715why, one step back715const testAppendInput = async (t, reversed, type, execaMethod) => {Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 716why, one step back716 const stdin = [foobarUint8Array, generatorsMap[type].uppercase(), generatorsMap[type].append()];Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 717why, one step back717 const reversedStdin = reversed ? stdin.reverse() : stdin;Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
line 718why, one step back718 const {stdout} = await execaMethod('stdin-fd.js', ['0'], {stdin: reversedStdin});Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
lines 719–722why, one step back719 const reversedSuffix = reversed ? casedSuffix.toUpperCase() : casedSuffix;720 t.is(stdout, `${foobarUppercase}${reversedSuffix}`);721};722Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
lines 723–730why, one step back723test('Can use multiple generators as input', testAppendInput, false, 'generator', execa);724test('Can use multiple generators as input, reversed', testAppendInput, true, 'generator', execa);725test('Can use multiple generators as input, sync', testAppendInput, false, 'generator', execaSync);726test('Can use multiple generators as input, reversed, sync', testAppendInput, true, 'generator', execaSync);727test('Can use multiple duplexes as input', testAppendInput, false, 'duplex', execa);728test('Can use multiple duplexes as input, reversed', testAppendInput, true, 'duplex', execa);729test('Can use multiple webTransforms as input', testAppendInput, false, 'webTransform', execa);730test('Can use multiple webTransforms as input, reversed', testAppendInput, true, 'webTransform', execa);Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 731why, one step back731Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
line 732why, one step back732const testAppendOutput = async (t, reversed, type, execaMethod) => {Add support for `std*: duplex` option (#937)ehmickybefore adoption6ca44fb
line 733why, one step back733 const stdoutOption = [generatorsMap[type].uppercase(), generatorsMap[type].append()];Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 734why, one step back734 const reversedStdoutOption = reversed ? stdoutOption.reverse() : stdoutOption;Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
line 735why, one step back735 const {stdout} = await execaMethod('noop-fd.js', ['1', foobarString], {stdout: reversedStdoutOption});Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
lines 736–739why, one step back736 const reversedSuffix = reversed ? casedSuffix.toUpperCase() : casedSuffix;737 t.is(stdout, `${foobarUppercase}${reversedSuffix}`);738};739Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
lines 740–747why, one step back740test('Can use multiple generators as output', testAppendOutput, false, 'generator', execa);741test('Can use multiple generators as output, reversed', testAppendOutput, true, 'generator', execa);742test('Can use multiple generators as output, sync', testAppendOutput, false, 'generator', execaSync);743test('Can use multiple generators as output, reversed, sync', testAppendOutput, true, 'generator', execaSync);744test('Can use multiple duplexes as output', testAppendOutput, false, 'duplex', execa);745test('Can use multiple duplexes as output, reversed', testAppendOutput, true, 'duplex', execa);746test('Can use multiple webTransforms as output', testAppendOutput, false, 'webTransform', execa);747test('Can use multiple webTransforms as output, reversed', testAppendOutput, true, 'webTransform', execa);Allow passing generators to the `std*` options (#693)ehmickybefore adoptione8f6bbd
line 748why, one step back748Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
lines 749–751why, one step back749// eslint-disable-next-line max-params750const testTwoGenerators = async (t, producesTwo, execaMethod, firstGenerator, secondGenerator = firstGenerator) => {751 const {stdout} = await execaMethod('noop-fd.js', ['1', foobarString], {stdout: [firstGenerator, secondGenerator]});Refactor tests (#934)ehmickybefore adoption52c4bde
lines 752–755why, one step back752 const expectedSuffix = producesTwo ? `${casedSuffix}${casedSuffix}` : casedSuffix;753 t.is(stdout, `${foobarString}${expectedSuffix}`);754};755Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
lines 756–766why, one step back756test('Can use multiple identical generators', testTwoGenerators, true, execa, appendGenerator().transform);757test('Can use multiple identical generators, options object', testTwoGenerators, true, execa, appendGenerator());758test('Can use multiple identical generators, async', testTwoGenerators, true, execa, appendAsyncGenerator().transform);759test('Can use multiple identical generators, options object, async', testTwoGenerators, true, execa, appendAsyncGenerator());760test('Can use multiple identical generators, sync', testTwoGenerators, true, execaSync, appendGenerator().transform);761test('Can use multiple identical generators, options object, sync', testTwoGenerators, true, execaSync, appendGenerator());762test('Ignore duplicate identical duplexes', testTwoGenerators, false, execa, appendDuplex());763test('Ignore duplicate identical webTransforms', testTwoGenerators, false, execa, appendWebTransform());764test('Can use multiple generators with duplexes', testTwoGenerators, true, execa, appendGenerator(false, false, true), appendDuplex());765test('Can use multiple generators with webTransforms', testTwoGenerators, true, execa, appendGenerator(false, false, true), appendWebTransform());766test('Can use multiple duplexes with webTransforms', testTwoGenerators, true, execa, appendDuplex(), appendWebTransform());Refactor tests (#934)ehmickybefore adoption52c4bde
line 767why, one step back767Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
line 768why, one step back768const testGeneratorSyntax = async (t, type, usePlainObject, execaMethod) => {Add support for `std*: TransformStream` option (#938)ehmickybefore adoption45824d6
line 769why, one step back769 const transform = generatorsMap[type].uppercase();Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
line 770why, one step back770 const {stdout} = await execaMethod('noop-fd.js', ['1', foobarString], {stdout: usePlainObject ? transform : transform.transform});Refactor tests (#934)ehmickybefore adoption52c4bde
lines 771–773why, one step back771 t.is(stdout, foobarUppercase);772};773Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09
lines 774–779why, one step back774test('Can pass generators with an options plain object', testGeneratorSyntax, 'generator', false, execa);775test('Can pass generators without an options plain object', testGeneratorSyntax, 'generator', true, execa);776test('Can pass generators with an options plain object, sync', testGeneratorSyntax, 'generator', false, execaSync);777test('Can pass generators without an options plain object, sync', testGeneratorSyntax, 'generator', true, execaSync);778test('Can pass webTransforms with an options plain object', testGeneratorSyntax, 'webTransform', true, execa);779test('Can pass webTransforms without an options plain object', testGeneratorSyntax, 'webTransform', false, execa);