Skip to content
Myr

encoding-transform.js

This file

Path

test/stdio/encoding-transform.js

358 lines · 42.1 KiB · JavaScript

Last changed by

Improve `encoding` option (#958)ehmickybefore adoption507b09c

History of this file

Take it

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 1–2why, one step back
1import {Buffer} from 'node:buffer';
2import test from 'ava';

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

line 3why, one step back
3import {execa, execaSync} from '../../index.js';

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 4–6why, one step back
4import {setFixtureDir} from '../helpers/fixtures-dir.js';
5import {getStdio} from '../helpers/stdio.js';6import {foobarString, foobarUint8Array, foobarBuffer, foobarObject} from '../helpers/input.js';

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

line 7why, one step back
7import {noopGenerator, getOutputGenerator, getOutputsGenerator, convertTransformToFinal} from '../helpers/generator.js';

Add `binary` and `preserveNewlines` options to `subprocess.readable()` (#922)ehmickybefore adoption56ee48e

line 8why, one step back
8import {multibyteChar, multibyteString, multibyteUint8Array, breakingLength, brokenSymbol} from '../helpers/encoding.js';

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 9–11why, one step back
9
10setFixtureDir();11

Improve `encoding` option (#958)ehmickybefore adoption507b09c

line 12why, one step back
12const getTypeofGenerator = lines => (objectMode, binary) => ({

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

line 13why, one step back
13 * transform(line) {

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 14–15why, one step back
14 lines.push(Object.prototype.toString.call(line));
15 yield '';

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 16–17why, one step back
16 },
17 objectMode,

Strip newlines in transforms (#919)ehmickybefore adoption26e9150

line 18why, one step back
18 binary,

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 19–20why, one step back
19});
20

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 21–22why, one step back
21const assertTypeofChunk = (t, lines, expectedType) => {
22 t.deepEqual(lines, [`[object ${expectedType}]`]);

Prevent handling binary data like text data (#924)ehmickybefore adoptionaf3aefd

lines 23–24why, one step back
23};
24

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

line 25why, one step back
25// eslint-disable-next-line max-params

Prevent handling binary data like text data (#924)ehmickybefore adoptionaf3aefd

line 26why, one step back
26const testGeneratorFirstEncoding = async (t, input, encoding, expectedType, objectMode, binary) => {

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 27–28why, one step back
27 const lines = [];
28 const subprocess = execa('stdin.js', {stdin: getTypeofGenerator(lines)(objectMode, binary), encoding});

Rename `spawned` and `child process` to `subprocess` (#897)ehmickybefore adoption8fe2343

line 29why, one step back
29 subprocess.stdin.end(input);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 30–31why, one step back
30 await subprocess;
31 assertTypeofChunk(t, lines, expectedType);

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 32–33why, one step back
32};
33

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 34–36why, one step back
34test('First generator argument is string with default encoding, with string writes', testGeneratorFirstEncoding, foobarString, 'utf8', 'String', false, undefined);
35test('First generator argument is string with default encoding, with Buffer writes', testGeneratorFirstEncoding, foobarBuffer, 'utf8', 'String', false, undefined);36test('First generator argument is string with default encoding, with Uint8Array writes', testGeneratorFirstEncoding, foobarUint8Array, 'utf8', 'String', false, undefined);

Prevent handling binary data like text data (#924)ehmickybefore adoptionaf3aefd

lines 37–38why, one step back
37test('First generator argument is string with default encoding, with string writes, "binary: false"', testGeneratorFirstEncoding, foobarString, 'utf8', 'String', false, false);
38test('First generator argument is Uint8Array with default encoding, with string writes, "binary: true"', testGeneratorFirstEncoding, foobarString, 'utf8', 'Uint8Array', false, true);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 39–46why, one step back
39test('First generator argument is string with encoding "utf16le", with string writes', testGeneratorFirstEncoding, foobarString, 'utf16le', 'String', false, undefined);
40test('First generator argument is string with encoding "utf16le", with Buffer writes', testGeneratorFirstEncoding, foobarBuffer, 'utf16le', 'String', false, undefined);41test('First generator argument is string with encoding "utf16le", with Uint8Array writes', testGeneratorFirstEncoding, foobarUint8Array, 'utf16le', 'String', false, undefined);42test('First generator argument is string with encoding "utf16le", with string writes, "binary: false"', testGeneratorFirstEncoding, foobarString, 'utf16le', 'String', false, false);43test('First generator argument is Uint8Array with encoding "utf16le", with string writes, "binary: true"', testGeneratorFirstEncoding, foobarString, 'utf16le', 'Uint8Array', false, true);44test('First generator argument is Uint8Array with encoding "buffer", with string writes', testGeneratorFirstEncoding, foobarString, 'buffer', 'Uint8Array', false, undefined);45test('First generator argument is Uint8Array with encoding "buffer", with Buffer writes', testGeneratorFirstEncoding, foobarBuffer, 'buffer', 'Uint8Array', false, undefined);46test('First generator argument is Uint8Array with encoding "buffer", with Uint8Array writes', testGeneratorFirstEncoding, foobarUint8Array, 'buffer', 'Uint8Array', false, undefined);

Prevent handling binary data like text data (#924)ehmickybefore adoptionaf3aefd

lines 47–48why, one step back
47test('First generator argument is Uint8Array with encoding "buffer", with string writes, "binary: false"', testGeneratorFirstEncoding, foobarString, 'buffer', 'Uint8Array', false, false);
48test('First generator argument is Uint8Array with encoding "buffer", with string writes, "binary: true"', testGeneratorFirstEncoding, foobarString, 'buffer', 'Uint8Array', false, true);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 49–51why, one step back
49test('First generator argument is Uint8Array with encoding "hex", with string writes', testGeneratorFirstEncoding, foobarString, 'hex', 'Uint8Array', false, undefined);
50test('First generator argument is Uint8Array with encoding "hex", with Buffer writes', testGeneratorFirstEncoding, foobarBuffer, 'hex', 'Uint8Array', false, undefined);51test('First generator argument is Uint8Array with encoding "hex", with Uint8Array writes', testGeneratorFirstEncoding, foobarUint8Array, 'hex', 'Uint8Array', false, undefined);

Improve handling of `encoding` option (#926)ehmickybefore adoptiond786fcf

line 52why, one step back
52test('First generator argument is Uint8Array with encoding "hex", with string writes, "binary: false"', testGeneratorFirstEncoding, foobarString, 'hex', 'Uint8Array', false, false);

Prevent handling binary data like text data (#924)ehmickybefore adoptionaf3aefd

line 53why, one step back
53test('First generator argument is Uint8Array with encoding "hex", with string writes, "binary: true"', testGeneratorFirstEncoding, foobarString, 'hex', 'Uint8Array', false, true);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 54–59why, one step back
54test('First generator argument can be string with objectMode', testGeneratorFirstEncoding, foobarString, 'utf8', 'String', true, undefined);
55test('First generator argument can be string with objectMode, "binary: false"', testGeneratorFirstEncoding, foobarString, 'utf8', 'String', true, false);56test('First generator argument can be string with objectMode, "binary: true"', testGeneratorFirstEncoding, foobarString, 'utf8', 'String', true, true);57test('First generator argument can be objects with objectMode', testGeneratorFirstEncoding, foobarObject, 'utf8', 'Object', true, undefined);58test('First generator argument can be objects with objectMode, "binary: false"', testGeneratorFirstEncoding, foobarObject, 'utf8', 'Object', true, false);59test('First generator argument can be objects with objectMode, "binary: true"', testGeneratorFirstEncoding, foobarObject, 'utf8', 'Object', true, true);

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

line 60why, one step back
60

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 61–62why, one step back
61// eslint-disable-next-line max-params
62const testGeneratorFirstEncodingSync = (t, input, encoding, expectedType, objectMode, binary) => {

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 63–65why, one step back
63 const lines = [];
64 execaSync('stdin.js', {stdin: [[input], getTypeofGenerator(lines)(objectMode, binary)], encoding});65 assertTypeofChunk(t, lines, expectedType);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 66–67why, one step back
66};
67

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 68–69why, one step back
68test('First generator argument is string with default encoding, with string writes, sync', testGeneratorFirstEncodingSync, foobarString, 'utf8', 'String', false, undefined);
69test('First generator argument is string with default encoding, with Uint8Array writes, sync', testGeneratorFirstEncodingSync, foobarUint8Array, 'utf8', 'String', false, undefined);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 70–71why, one step back
70test('First generator argument is string with default encoding, with string writes, "binary: false", sync', testGeneratorFirstEncodingSync, foobarString, 'utf8', 'String', false, false);
71test('First generator argument is Uint8Array with default encoding, with string writes, "binary: true", sync', testGeneratorFirstEncodingSync, foobarString, 'utf8', 'Uint8Array', false, true);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 72–77why, one step back
72test('First generator argument is string with encoding "utf16le", with string writes, sync', testGeneratorFirstEncodingSync, foobarString, 'utf16le', 'String', false, undefined);
73test('First generator argument is string with encoding "utf16le", with Uint8Array writes, sync', testGeneratorFirstEncodingSync, foobarUint8Array, 'utf16le', 'String', false, undefined);74test('First generator argument is string with encoding "utf16le", with string writes, "binary: false", sync', testGeneratorFirstEncodingSync, foobarString, 'utf16le', 'String', false, false);75test('First generator argument is Uint8Array with encoding "utf16le", with string writes, "binary: true", sync', testGeneratorFirstEncodingSync, foobarString, 'utf16le', 'Uint8Array', false, true);76test('First generator argument is Uint8Array with encoding "buffer", with string writes, sync', testGeneratorFirstEncodingSync, foobarString, 'buffer', 'Uint8Array', false, undefined);77test('First generator argument is Uint8Array with encoding "buffer", with Uint8Array writes, sync', testGeneratorFirstEncodingSync, foobarUint8Array, 'buffer', 'Uint8Array', false, undefined);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 78–79why, one step back
78test('First generator argument is Uint8Array with encoding "buffer", with string writes, "binary: false", sync', testGeneratorFirstEncodingSync, foobarString, 'buffer', 'Uint8Array', false, false);
79test('First generator argument is Uint8Array with encoding "buffer", with string writes, "binary: true", sync', testGeneratorFirstEncodingSync, foobarString, 'buffer', 'Uint8Array', false, true);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 80–81why, one step back
80test('First generator argument is Uint8Array with encoding "hex", with string writes, sync', testGeneratorFirstEncodingSync, foobarString, 'hex', 'Uint8Array', false, undefined);
81test('First generator argument is Uint8Array with encoding "hex", with Uint8Array writes, sync', testGeneratorFirstEncodingSync, foobarUint8Array, 'hex', 'Uint8Array', false, undefined);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 82–83why, one step back
82test('First generator argument is Uint8Array with encoding "hex", with string writes, "binary: false", sync', testGeneratorFirstEncodingSync, foobarString, 'hex', 'Uint8Array', false, false);
83test('First generator argument is Uint8Array with encoding "hex", with string writes, "binary: true", sync', testGeneratorFirstEncodingSync, foobarString, 'hex', 'Uint8Array', false, true);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 84–89why, one step back
84test('First generator argument can be string with objectMode, sync', testGeneratorFirstEncodingSync, foobarString, 'utf8', 'String', true, undefined);
85test('First generator argument can be string with objectMode, "binary: false", sync', testGeneratorFirstEncodingSync, foobarString, 'utf8', 'String', true, false);86test('First generator argument can be string with objectMode, "binary: true", sync', testGeneratorFirstEncodingSync, foobarString, 'utf8', 'String', true, true);87test('First generator argument can be objects with objectMode, sync', testGeneratorFirstEncodingSync, foobarObject, 'utf8', 'Object', true, undefined);88test('First generator argument can be objects with objectMode, "binary: false", sync', testGeneratorFirstEncodingSync, foobarObject, 'utf8', 'Object', true, false);89test('First generator argument can be objects with objectMode, "binary: true", sync', testGeneratorFirstEncodingSync, foobarObject, 'utf8', 'Object', true, true);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

line 90why, one step back
90

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 91–92why, one step back
91const testEncodingIgnored = async (t, encoding) => {
92 const input = Buffer.from(foobarString).toString(encoding);

Rename `spawned` and `child process` to `subprocess` (#897)ehmickybefore adoption8fe2343

lines 93–95why, one step back
93 const subprocess = execa('stdin.js', {stdin: noopGenerator(true)});
94 subprocess.stdin.end(input, encoding);95 const {stdout} = await subprocess;

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 96–104why, one step back
96 t.is(stdout, input);
97};9899test('Write call encoding "utf8" is ignored with objectMode', testEncodingIgnored, 'utf8');100test('Write call encoding "utf16le" is ignored with objectMode', testEncodingIgnored, 'utf16le');101test('Write call encoding "hex" is ignored with objectMode', testEncodingIgnored, 'hex');102test('Write call encoding "base64" is ignored with objectMode', testEncodingIgnored, 'base64');103104// eslint-disable-next-line max-params

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

line 105why, one step back
105const testGeneratorNextEncoding = async (t, input, encoding, firstObjectMode, secondObjectMode, expectedType, execaMethod) => {

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 106–107why, one step back
106 const lines = [];
107 await execaMethod('noop.js', ['other'], {

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

line 108why, one step back
108 stdout: [

Refactor tests (#934)ehmickybefore adoption52c4bde

line 109why, one step back
109 getOutputGenerator(input)(firstObjectMode),

Improve `encoding` option (#958)ehmickybefore adoption507b09c

line 110why, one step back
110 getTypeofGenerator(lines)(secondObjectMode),

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 111–113why, one step back
111 ],
112 encoding,113 });

Improve `encoding` option (#958)ehmickybefore adoption507b09c

line 114why, one step back
114 assertTypeofChunk(t, lines, expectedType);

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 115–116why, one step back
115};
116

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 117–122why, one step back
117test('Next generator argument is string with default encoding, with string writes', testGeneratorNextEncoding, foobarString, 'utf8', false, false, 'String', execa);
118test('Next generator argument is string with default encoding, with string writes, objectMode first', testGeneratorNextEncoding, foobarString, 'utf8', true, false, 'String', execa);119test('Next generator argument is string with default encoding, with string writes, objectMode both', testGeneratorNextEncoding, foobarString, 'utf8', true, true, 'String', execa);120test('Next generator argument is string with default encoding, with Uint8Array writes', testGeneratorNextEncoding, foobarUint8Array, 'utf8', false, false, 'String', execa);121test('Next generator argument is Uint8Array with default encoding, with Uint8Array writes, objectMode first', testGeneratorNextEncoding, foobarUint8Array, 'utf8', true, false, 'Uint8Array', execa);122test('Next generator argument is string with default encoding, with Uint8Array writes, objectMode both', testGeneratorNextEncoding, foobarUint8Array, 'utf8', true, true, 'Uint8Array', execa);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 123–128why, one step back
123test('Next generator argument is string with encoding "utf16le", with string writes', testGeneratorNextEncoding, foobarString, 'utf16le', false, false, 'String', execa);
124test('Next generator argument is string with encoding "utf16le",, with string writes, objectMode first', testGeneratorNextEncoding, foobarString, 'utf16le', true, false, 'String', execa);125test('Next generator argument is string with encoding "utf16le",, with string writes, objectMode both', testGeneratorNextEncoding, foobarString, 'utf16le', true, true, 'String', execa);126test('Next generator argument is string with encoding "utf16le",, with Uint8Array writes', testGeneratorNextEncoding, foobarUint8Array, 'utf16le', false, false, 'String', execa);127test('Next generator argument is Uint8Array with encoding "utf16le",, with Uint8Array writes, objectMode first', testGeneratorNextEncoding, foobarUint8Array, 'utf16le', true, false, 'Uint8Array', execa);128test('Next generator argument is string with encoding "utf16le",, with Uint8Array writes, objectMode both', testGeneratorNextEncoding, foobarUint8Array, 'utf16le', true, true, 'Uint8Array', execa);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 129–144why, one step back
129test('Next generator argument is Uint8Array with encoding "buffer", with string writes', testGeneratorNextEncoding, foobarString, 'buffer', false, false, 'Uint8Array', execa);
130test('Next generator argument is string with encoding "buffer", with string writes, objectMode first', testGeneratorNextEncoding, foobarString, 'buffer', true, false, 'String', execa);131test('Next generator argument is string with encoding "buffer", with string writes, objectMode both', testGeneratorNextEncoding, foobarString, 'buffer', true, true, 'String', execa);132test('Next generator argument is Uint8Array with encoding "buffer", with Uint8Array writes', testGeneratorNextEncoding, foobarUint8Array, 'buffer', false, false, 'Uint8Array', execa);133test('Next generator argument is Uint8Array with encoding "buffer", with Uint8Array writes, objectMode first', testGeneratorNextEncoding, foobarUint8Array, 'buffer', true, false, 'Uint8Array', execa);134test('Next generator argument is Uint8Array with encoding "buffer", with Uint8Array writes, objectMode both', testGeneratorNextEncoding, foobarUint8Array, 'buffer', true, true, 'Uint8Array', execa);135test('Next generator argument is Uint8Array with encoding "hex", with string writes', testGeneratorNextEncoding, foobarString, 'hex', false, false, 'Uint8Array', execa);136test('Next generator argument is Uint8Array with encoding "hex", with Uint8Array writes', testGeneratorNextEncoding, foobarUint8Array, 'hex', false, false, 'Uint8Array', execa);137test('Next generator argument is object with default encoding, with object writes, objectMode first', testGeneratorNextEncoding, foobarObject, 'utf8', true, false, 'Object', execa);138test('Next generator argument is object with default encoding, with object writes, objectMode both', testGeneratorNextEncoding, foobarObject, 'utf8', true, true, 'Object', execa);139test('Next generator argument is string with default encoding, with string writes, sync', testGeneratorNextEncoding, foobarString, 'utf8', false, false, 'String', execaSync);140test('Next generator argument is string with default encoding, with string writes, objectMode first, sync', testGeneratorNextEncoding, foobarString, 'utf8', true, false, 'String', execaSync);141test('Next generator argument is string with default encoding, with string writes, objectMode both, sync', testGeneratorNextEncoding, foobarString, 'utf8', true, true, 'String', execaSync);142test('Next generator argument is string with default encoding, with Uint8Array writes, sync', testGeneratorNextEncoding, foobarUint8Array, 'utf8', false, false, 'String', execaSync);143test('Next generator argument is Uint8Array with default encoding, with Uint8Array writes, objectMode first, sync', testGeneratorNextEncoding, foobarUint8Array, 'utf8', true, false, 'Uint8Array', execaSync);144test('Next generator argument is string with default encoding, with Uint8Array writes, objectMode both, sync', testGeneratorNextEncoding, foobarUint8Array, 'utf8', true, true, 'Uint8Array', execaSync);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 145–150why, one step back
145test('Next generator argument is string with encoding "utf16le", with string writes, sync', testGeneratorNextEncoding, foobarString, 'utf16le', false, false, 'String', execaSync);
146test('Next generator argument is string with encoding "utf16le",, with string writes, objectMode first, sync', testGeneratorNextEncoding, foobarString, 'utf16le', true, false, 'String', execaSync);147test('Next generator argument is string with encoding "utf16le",, with string writes, objectMode both, sync', testGeneratorNextEncoding, foobarString, 'utf16le', true, true, 'String', execaSync);148test('Next generator argument is string with encoding "utf16le",, with Uint8Array writes, sync', testGeneratorNextEncoding, foobarUint8Array, 'utf16le', false, false, 'String', execaSync);149test('Next generator argument is Uint8Array with encoding "utf16le",, with Uint8Array writes, objectMode first, sync', testGeneratorNextEncoding, foobarUint8Array, 'utf16le', true, false, 'Uint8Array', execaSync);150test('Next generator argument is string with encoding "utf16le",, with Uint8Array writes, objectMode both, sync', testGeneratorNextEncoding, foobarUint8Array, 'utf16le', true, true, 'Uint8Array', execaSync);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 151–160why, one step back
151test('Next generator argument is Uint8Array with encoding "buffer", with string writes, sync', testGeneratorNextEncoding, foobarString, 'buffer', false, false, 'Uint8Array', execaSync);
152test('Next generator argument is string with encoding "buffer", with string writes, objectMode first, sync', testGeneratorNextEncoding, foobarString, 'buffer', true, false, 'String', execaSync);153test('Next generator argument is string with encoding "buffer", with string writes, objectMode both, sync', testGeneratorNextEncoding, foobarString, 'buffer', true, true, 'String', execaSync);154test('Next generator argument is Uint8Array with encoding "buffer", with Uint8Array writes, sync', testGeneratorNextEncoding, foobarUint8Array, 'buffer', false, false, 'Uint8Array', execaSync);155test('Next generator argument is Uint8Array with encoding "buffer", with Uint8Array writes, objectMode first, sync', testGeneratorNextEncoding, foobarUint8Array, 'buffer', true, false, 'Uint8Array', execaSync);156test('Next generator argument is Uint8Array with encoding "buffer", with Uint8Array writes, objectMode both, sync', testGeneratorNextEncoding, foobarUint8Array, 'buffer', true, true, 'Uint8Array', execaSync);157test('Next generator argument is Uint8Array with encoding "hex", with string writes, sync', testGeneratorNextEncoding, foobarString, 'hex', false, false, 'Uint8Array', execaSync);158test('Next generator argument is Uint8Array with encoding "hex", with Uint8Array writes, sync', testGeneratorNextEncoding, foobarUint8Array, 'hex', false, false, 'Uint8Array', execaSync);159test('Next generator argument is object with default encoding, with object writes, objectMode first, sync', testGeneratorNextEncoding, foobarObject, 'utf8', true, false, 'Object', execaSync);160test('Next generator argument is object with default encoding, with object writes, objectMode both, sync', testGeneratorNextEncoding, foobarObject, 'utf8', true, true, 'Object', execaSync);

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

line 161why, one step back
161

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

line 162why, one step back
162const testFirstOutputGeneratorArgument = async (t, fdNumber, execaMethod) => {

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 163–165why, one step back
163 const lines = [];
164 await execaMethod('noop-fd.js', [`${fdNumber}`], getStdio(fdNumber, getTypeofGenerator(lines)(true)));165 assertTypeofChunk(t, lines, 'String');

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 166–167why, one step back
166};
167

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 168–173why, one step back
168test('The first generator with result.stdout does not receive an object argument even in objectMode', testFirstOutputGeneratorArgument, 1, execa);
169test('The first generator with result.stderr does not receive an object argument even in objectMode', testFirstOutputGeneratorArgument, 2, execa);170test('The first generator with result.stdio[*] does not receive an object argument even in objectMode', testFirstOutputGeneratorArgument, 3, execa);171test('The first generator with result.stdout does not receive an object argument even in objectMode, sync', testFirstOutputGeneratorArgument, 1, execaSync);172test('The first generator with result.stderr does not receive an object argument even in objectMode, sync', testFirstOutputGeneratorArgument, 2, execaSync);173test('The first generator with result.stdio[*] does not receive an object argument even in objectMode, sync', testFirstOutputGeneratorArgument, 3, execaSync);

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 174–175why, one step back
174
175// eslint-disable-next-line max-params

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

line 176why, one step back
176const testGeneratorReturnType = async (t, input, encoding, reject, objectMode, final, execaMethod) => {

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

line 177why, one step back
177 const fixtureName = reject ? 'noop-fd.js' : 'noop-fail.js';

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

line 178why, one step back
178 const {stdout} = await execaMethod(fixtureName, ['1', foobarString], {

Refactor tests (#934)ehmickybefore adoption52c4bde

line 179why, one step back
179 stdout: convertTransformToFinal(getOutputGenerator(input)(objectMode, true), final),

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 180–183why, one step back
180 encoding,
181 reject,182 });183 const typeofChunk = Array.isArray(stdout) ? stdout[0] : stdout;

Fix strings returned by transforms in `objectMode` (#917)ehmickybefore adoption98f403c

line 184why, one step back
184 const output = Buffer.from(typeofChunk, encoding === 'buffer' || objectMode ? undefined : encoding).toString();

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 185–187why, one step back
185 t.is(output, foobarString);
186};187

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 188–189why, one step back
188test('Generator can return string with default encoding', testGeneratorReturnType, foobarString, 'utf8', true, false, false, execa);
189test('Generator can return Uint8Array with default encoding', testGeneratorReturnType, foobarUint8Array, 'utf8', true, false, false, execa);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 190–191why, one step back
190test('Generator can return string with encoding "utf16le"', testGeneratorReturnType, foobarString, 'utf16le', true, false, false, execa);
191test('Generator can return Uint8Array with encoding "utf16le"', testGeneratorReturnType, foobarUint8Array, 'utf16le', true, false, false, execa);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 192–197why, one step back
192test('Generator can return string with encoding "buffer"', testGeneratorReturnType, foobarString, 'buffer', true, false, false, execa);
193test('Generator can return Uint8Array with encoding "buffer"', testGeneratorReturnType, foobarUint8Array, 'buffer', true, false, false, execa);194test('Generator can return string with encoding "hex"', testGeneratorReturnType, foobarString, 'hex', true, false, false, execa);195test('Generator can return Uint8Array with encoding "hex"', testGeneratorReturnType, foobarUint8Array, 'hex', true, false, false, execa);196test('Generator can return string with default encoding, failure', testGeneratorReturnType, foobarString, 'utf8', false, false, false, execa);197test('Generator can return Uint8Array with default encoding, failure', testGeneratorReturnType, foobarUint8Array, 'utf8', false, false, false, execa);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 198–199why, one step back
198test('Generator can return string with encoding "utf16le", failure', testGeneratorReturnType, foobarString, 'utf16le', false, false, false, execa);
199test('Generator can return Uint8Array with encoding "utf16le", failure', testGeneratorReturnType, foobarUint8Array, 'utf16le', false, false, false, execa);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 200–205why, one step back
200test('Generator can return string with encoding "buffer", failure', testGeneratorReturnType, foobarString, 'buffer', false, false, false, execa);
201test('Generator can return Uint8Array with encoding "buffer", failure', testGeneratorReturnType, foobarUint8Array, 'buffer', false, false, false, execa);202test('Generator can return string with encoding "hex", failure', testGeneratorReturnType, foobarString, 'hex', false, false, false, execa);203test('Generator can return Uint8Array with encoding "hex", failure', testGeneratorReturnType, foobarUint8Array, 'hex', false, false, false, execa);204test('Generator can return string with default encoding, objectMode', testGeneratorReturnType, foobarString, 'utf8', true, true, false, execa);205test('Generator can return Uint8Array with default encoding, objectMode', testGeneratorReturnType, foobarUint8Array, 'utf8', true, true, false, execa);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 206–207why, one step back
206test('Generator can return string with encoding "utf16le", objectMode', testGeneratorReturnType, foobarString, 'utf16le', true, true, false, execa);
207test('Generator can return Uint8Array with encoding "utf16le", objectMode', testGeneratorReturnType, foobarUint8Array, 'utf16le', true, true, false, execa);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 208–213why, one step back
208test('Generator can return string with encoding "buffer", objectMode', testGeneratorReturnType, foobarString, 'buffer', true, true, false, execa);
209test('Generator can return Uint8Array with encoding "buffer", objectMode', testGeneratorReturnType, foobarUint8Array, 'buffer', true, true, false, execa);210test('Generator can return string with encoding "hex", objectMode', testGeneratorReturnType, foobarString, 'hex', true, true, false, execa);211test('Generator can return Uint8Array with encoding "hex", objectMode', testGeneratorReturnType, foobarUint8Array, 'hex', true, true, false, execa);212test('Generator can return string with default encoding, objectMode, failure', testGeneratorReturnType, foobarString, 'utf8', false, true, false, execa);213test('Generator can return Uint8Array with default encoding, objectMode, failure', testGeneratorReturnType, foobarUint8Array, 'utf8', false, true, false, execa);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 214–215why, one step back
214test('Generator can return string with encoding "utf16le", objectMode, failure', testGeneratorReturnType, foobarString, 'utf16le', false, true, false, execa);
215test('Generator can return Uint8Array with encoding "utf16le", objectMode, failure', testGeneratorReturnType, foobarUint8Array, 'utf16le', false, true, false, execa);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 216–221why, one step back
216test('Generator can return string with encoding "buffer", objectMode, failure', testGeneratorReturnType, foobarString, 'buffer', false, true, false, execa);
217test('Generator can return Uint8Array with encoding "buffer", objectMode, failure', testGeneratorReturnType, foobarUint8Array, 'buffer', false, true, false, execa);218test('Generator can return string with encoding "hex", objectMode, failure', testGeneratorReturnType, foobarString, 'hex', false, true, false, execa);219test('Generator can return Uint8Array with encoding "hex", objectMode, failure', testGeneratorReturnType, foobarUint8Array, 'hex', false, true, false, execa);220test('Generator can return final string with default encoding', testGeneratorReturnType, foobarString, 'utf8', true, false, true, execa);221test('Generator can return final Uint8Array with default encoding', testGeneratorReturnType, foobarUint8Array, 'utf8', true, false, true, execa);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 222–223why, one step back
222test('Generator can return final string with encoding "utf16le"', testGeneratorReturnType, foobarString, 'utf16le', true, false, true, execa);
223test('Generator can return final Uint8Array with encoding "utf16le"', testGeneratorReturnType, foobarUint8Array, 'utf16le', true, false, true, execa);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 224–229why, one step back
224test('Generator can return final string with encoding "buffer"', testGeneratorReturnType, foobarString, 'buffer', true, false, true, execa);
225test('Generator can return final Uint8Array with encoding "buffer"', testGeneratorReturnType, foobarUint8Array, 'buffer', true, false, true, execa);226test('Generator can return final string with encoding "hex"', testGeneratorReturnType, foobarString, 'hex', true, false, true, execa);227test('Generator can return final Uint8Array with encoding "hex"', testGeneratorReturnType, foobarUint8Array, 'hex', true, false, true, execa);228test('Generator can return final string with default encoding, failure', testGeneratorReturnType, foobarString, 'utf8', false, false, true, execa);229test('Generator can return final Uint8Array with default encoding, failure', testGeneratorReturnType, foobarUint8Array, 'utf8', false, false, true, execa);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 230–231why, one step back
230test('Generator can return final string with encoding "utf16le", failure', testGeneratorReturnType, foobarString, 'utf16le', false, false, true, execa);
231test('Generator can return final Uint8Array with encoding "utf16le", failure', testGeneratorReturnType, foobarUint8Array, 'utf16le', false, false, true, execa);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 232–237why, one step back
232test('Generator can return final string with encoding "buffer", failure', testGeneratorReturnType, foobarString, 'buffer', false, false, true, execa);
233test('Generator can return final Uint8Array with encoding "buffer", failure', testGeneratorReturnType, foobarUint8Array, 'buffer', false, false, true, execa);234test('Generator can return final string with encoding "hex", failure', testGeneratorReturnType, foobarString, 'hex', false, false, true, execa);235test('Generator can return final Uint8Array with encoding "hex", failure', testGeneratorReturnType, foobarUint8Array, 'hex', false, false, true, execa);236test('Generator can return final string with default encoding, objectMode', testGeneratorReturnType, foobarString, 'utf8', true, true, true, execa);237test('Generator can return final Uint8Array with default encoding, objectMode', testGeneratorReturnType, foobarUint8Array, 'utf8', true, true, true, execa);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 238–239why, one step back
238test('Generator can return final string with encoding "utf16le", objectMode', testGeneratorReturnType, foobarString, 'utf16le', true, true, true, execa);
239test('Generator can return final Uint8Array with encoding "utf16le", objectMode', testGeneratorReturnType, foobarUint8Array, 'utf16le', true, true, true, execa);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 240–245why, one step back
240test('Generator can return final string with encoding "buffer", objectMode', testGeneratorReturnType, foobarString, 'buffer', true, true, true, execa);
241test('Generator can return final Uint8Array with encoding "buffer", objectMode', testGeneratorReturnType, foobarUint8Array, 'buffer', true, true, true, execa);242test('Generator can return final string with encoding "hex", objectMode', testGeneratorReturnType, foobarString, 'hex', true, true, true, execa);243test('Generator can return final Uint8Array with encoding "hex", objectMode', testGeneratorReturnType, foobarUint8Array, 'hex', true, true, true, execa);244test('Generator can return final string with default encoding, objectMode, failure', testGeneratorReturnType, foobarString, 'utf8', false, true, true, execa);245test('Generator can return final Uint8Array with default encoding, objectMode, failure', testGeneratorReturnType, foobarUint8Array, 'utf8', false, true, true, execa);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 246–247why, one step back
246test('Generator can return final string with encoding "utf16le", objectMode, failure', testGeneratorReturnType, foobarString, 'utf16le', false, true, true, execa);
247test('Generator can return final Uint8Array with encoding "utf16le", objectMode, failure', testGeneratorReturnType, foobarUint8Array, 'utf16le', false, true, true, execa);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 248–253why, one step back
248test('Generator can return final string with encoding "buffer", objectMode, failure', testGeneratorReturnType, foobarString, 'buffer', false, true, true, execa);
249test('Generator can return final Uint8Array with encoding "buffer", objectMode, failure', testGeneratorReturnType, foobarUint8Array, 'buffer', false, true, true, execa);250test('Generator can return final string with encoding "hex", objectMode, failure', testGeneratorReturnType, foobarString, 'hex', false, true, true, execa);251test('Generator can return final Uint8Array with encoding "hex", objectMode, failure', testGeneratorReturnType, foobarUint8Array, 'hex', false, true, true, execa);252test('Generator can return string with default encoding, sync', testGeneratorReturnType, foobarString, 'utf8', true, false, false, execaSync);253test('Generator can return Uint8Array with default encoding, sync', testGeneratorReturnType, foobarUint8Array, 'utf8', true, false, false, execaSync);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 254–255why, one step back
254test('Generator can return string with encoding "utf16le", sync', testGeneratorReturnType, foobarString, 'utf16le', true, false, false, execaSync);
255test('Generator can return Uint8Array with encoding "utf16le", sync', testGeneratorReturnType, foobarUint8Array, 'utf16le', true, false, false, execaSync);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 256–261why, one step back
256test('Generator can return string with encoding "buffer", sync', testGeneratorReturnType, foobarString, 'buffer', true, false, false, execaSync);
257test('Generator can return Uint8Array with encoding "buffer", sync', testGeneratorReturnType, foobarUint8Array, 'buffer', true, false, false, execaSync);258test('Generator can return string with encoding "hex", sync', testGeneratorReturnType, foobarString, 'hex', true, false, false, execaSync);259test('Generator can return Uint8Array with encoding "hex", sync', testGeneratorReturnType, foobarUint8Array, 'hex', true, false, false, execaSync);260test('Generator can return string with default encoding, failure, sync', testGeneratorReturnType, foobarString, 'utf8', false, false, false, execaSync);261test('Generator can return Uint8Array with default encoding, failure, sync', testGeneratorReturnType, foobarUint8Array, 'utf8', false, false, false, execaSync);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 262–263why, one step back
262test('Generator can return string with encoding "utf16le", failure, sync', testGeneratorReturnType, foobarString, 'utf16le', false, false, false, execaSync);
263test('Generator can return Uint8Array with encoding "utf16le", failure, sync', testGeneratorReturnType, foobarUint8Array, 'utf16le', false, false, false, execaSync);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 264–269why, one step back
264test('Generator can return string with encoding "buffer", failure, sync', testGeneratorReturnType, foobarString, 'buffer', false, false, false, execaSync);
265test('Generator can return Uint8Array with encoding "buffer", failure, sync', testGeneratorReturnType, foobarUint8Array, 'buffer', false, false, false, execaSync);266test('Generator can return string with encoding "hex", failure, sync', testGeneratorReturnType, foobarString, 'hex', false, false, false, execaSync);267test('Generator can return Uint8Array with encoding "hex", failure, sync', testGeneratorReturnType, foobarUint8Array, 'hex', false, false, false, execaSync);268test('Generator can return string with default encoding, objectMode, sync', testGeneratorReturnType, foobarString, 'utf8', true, true, false, execaSync);269test('Generator can return Uint8Array with default encoding, objectMode, sync', testGeneratorReturnType, foobarUint8Array, 'utf8', true, true, false, execaSync);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 270–271why, one step back
270test('Generator can return string with encoding "utf16le", objectMode, sync', testGeneratorReturnType, foobarString, 'utf16le', true, true, false, execaSync);
271test('Generator can return Uint8Array with encoding "utf16le", objectMode, sync', testGeneratorReturnType, foobarUint8Array, 'utf16le', true, true, false, execaSync);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 272–277why, one step back
272test('Generator can return string with encoding "buffer", objectMode, sync', testGeneratorReturnType, foobarString, 'buffer', true, true, false, execaSync);
273test('Generator can return Uint8Array with encoding "buffer", objectMode, sync', testGeneratorReturnType, foobarUint8Array, 'buffer', true, true, false, execaSync);274test('Generator can return string with encoding "hex", objectMode, sync', testGeneratorReturnType, foobarString, 'hex', true, true, false, execaSync);275test('Generator can return Uint8Array with encoding "hex", objectMode, sync', testGeneratorReturnType, foobarUint8Array, 'hex', true, true, false, execaSync);276test('Generator can return string with default encoding, objectMode, failure, sync', testGeneratorReturnType, foobarString, 'utf8', false, true, false, execaSync);277test('Generator can return Uint8Array with default encoding, objectMode, failure, sync', testGeneratorReturnType, foobarUint8Array, 'utf8', false, true, false, execaSync);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 278–279why, one step back
278test('Generator can return string with encoding "utf16le", objectMode, failure, sync', testGeneratorReturnType, foobarString, 'utf16le', false, true, false, execaSync);
279test('Generator can return Uint8Array with encoding "utf16le", objectMode, failure, sync', testGeneratorReturnType, foobarUint8Array, 'utf16le', false, true, false, execaSync);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 280–285why, one step back
280test('Generator can return string with encoding "buffer", objectMode, failure, sync', testGeneratorReturnType, foobarString, 'buffer', false, true, false, execaSync);
281test('Generator can return Uint8Array with encoding "buffer", objectMode, failure, sync', testGeneratorReturnType, foobarUint8Array, 'buffer', false, true, false, execaSync);282test('Generator can return string with encoding "hex", objectMode, failure, sync', testGeneratorReturnType, foobarString, 'hex', false, true, false, execaSync);283test('Generator can return Uint8Array with encoding "hex", objectMode, failure, sync', testGeneratorReturnType, foobarUint8Array, 'hex', false, true, false, execaSync);284test('Generator can return final string with default encoding, sync', testGeneratorReturnType, foobarString, 'utf8', true, false, true, execaSync);285test('Generator can return final Uint8Array with default encoding, sync', testGeneratorReturnType, foobarUint8Array, 'utf8', true, false, true, execaSync);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 286–287why, one step back
286test('Generator can return final string with encoding "utf16le", sync', testGeneratorReturnType, foobarString, 'utf16le', true, false, true, execaSync);
287test('Generator can return final Uint8Array with encoding "utf16le", sync', testGeneratorReturnType, foobarUint8Array, 'utf16le', true, false, true, execaSync);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 288–293why, one step back
288test('Generator can return final string with encoding "buffer", sync', testGeneratorReturnType, foobarString, 'buffer', true, false, true, execaSync);
289test('Generator can return final Uint8Array with encoding "buffer", sync', testGeneratorReturnType, foobarUint8Array, 'buffer', true, false, true, execaSync);290test('Generator can return final string with encoding "hex", sync', testGeneratorReturnType, foobarString, 'hex', true, false, true, execaSync);291test('Generator can return final Uint8Array with encoding "hex", sync', testGeneratorReturnType, foobarUint8Array, 'hex', true, false, true, execaSync);292test('Generator can return final string with default encoding, failure, sync', testGeneratorReturnType, foobarString, 'utf8', false, false, true, execaSync);293test('Generator can return final Uint8Array with default encoding, failure, sync', testGeneratorReturnType, foobarUint8Array, 'utf8', false, false, true, execaSync);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 294–295why, one step back
294test('Generator can return final string with encoding "utf16le", failure, sync', testGeneratorReturnType, foobarString, 'utf16le', false, false, true, execaSync);
295test('Generator can return final Uint8Array with encoding "utf16le", failure, sync', testGeneratorReturnType, foobarUint8Array, 'utf16le', false, false, true, execaSync);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 296–301why, one step back
296test('Generator can return final string with encoding "buffer", failure, sync', testGeneratorReturnType, foobarString, 'buffer', false, false, true, execaSync);
297test('Generator can return final Uint8Array with encoding "buffer", failure, sync', testGeneratorReturnType, foobarUint8Array, 'buffer', false, false, true, execaSync);298test('Generator can return final string with encoding "hex", failure, sync', testGeneratorReturnType, foobarString, 'hex', false, false, true, execaSync);299test('Generator can return final Uint8Array with encoding "hex", failure, sync', testGeneratorReturnType, foobarUint8Array, 'hex', false, false, true, execaSync);300test('Generator can return final string with default encoding, objectMode, sync', testGeneratorReturnType, foobarString, 'utf8', true, true, true, execaSync);301test('Generator can return final Uint8Array with default encoding, objectMode, sync', testGeneratorReturnType, foobarUint8Array, 'utf8', true, true, true, execaSync);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 302–303why, one step back
302test('Generator can return final string with encoding "utf16le", objectMode, sync', testGeneratorReturnType, foobarString, 'utf16le', true, true, true, execaSync);
303test('Generator can return final Uint8Array with encoding "utf16le", objectMode, sync', testGeneratorReturnType, foobarUint8Array, 'utf16le', true, true, true, execaSync);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 304–309why, one step back
304test('Generator can return final string with encoding "buffer", objectMode, sync', testGeneratorReturnType, foobarString, 'buffer', true, true, true, execaSync);
305test('Generator can return final Uint8Array with encoding "buffer", objectMode, sync', testGeneratorReturnType, foobarUint8Array, 'buffer', true, true, true, execaSync);306test('Generator can return final string with encoding "hex", objectMode, sync', testGeneratorReturnType, foobarString, 'hex', true, true, true, execaSync);307test('Generator can return final Uint8Array with encoding "hex", objectMode, sync', testGeneratorReturnType, foobarUint8Array, 'hex', true, true, true, execaSync);308test('Generator can return final string with default encoding, objectMode, failure, sync', testGeneratorReturnType, foobarString, 'utf8', false, true, true, execaSync);309test('Generator can return final Uint8Array with default encoding, objectMode, failure, sync', testGeneratorReturnType, foobarUint8Array, 'utf8', false, true, true, execaSync);

Improve `encoding` option (#958)ehmickybefore adoption507b09c

lines 310–311why, one step back
310test('Generator can return final string with encoding "utf16le", objectMode, failure, sync', testGeneratorReturnType, foobarString, 'utf16le', false, true, true, execaSync);
311test('Generator can return final Uint8Array with encoding "utf16le", objectMode, failure, sync', testGeneratorReturnType, foobarUint8Array, 'utf16le', false, true, true, execaSync);

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 312–315why, one step back
312test('Generator can return final string with encoding "buffer", objectMode, failure, sync', testGeneratorReturnType, foobarString, 'buffer', false, true, true, execaSync);
313test('Generator can return final Uint8Array with encoding "buffer", objectMode, failure, sync', testGeneratorReturnType, foobarUint8Array, 'buffer', false, true, true, execaSync);314test('Generator can return final string with encoding "hex", objectMode, failure, sync', testGeneratorReturnType, foobarString, 'hex', false, true, true, execaSync);315test('Generator can return final Uint8Array with encoding "hex", objectMode, failure, sync', testGeneratorReturnType, foobarUint8Array, 'hex', false, true, true, execaSync);

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

line 316why, one step back
316

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 317–323why, one step back
317const testMultibyte = async (t, objectMode, execaMethod) => {
318 const {stdout} = await execaMethod('stdin.js', {319 stdin: [320 [multibyteUint8Array.slice(0, breakingLength), multibyteUint8Array.slice(breakingLength)],321 noopGenerator(objectMode, true),322 ],323 });

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 324–326why, one step back
324 t.is(stdout, multibyteString);
325};326

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 327–330why, one step back
327test('Generator handles multibyte characters with Uint8Array', testMultibyte, false, execa);
328test('Generator handles multibyte characters with Uint8Array, objectMode', testMultibyte, true, execa);329test('Generator handles multibyte characters with Uint8Array, sync', testMultibyte, false, execaSync);330test('Generator handles multibyte characters with Uint8Array, objectMode, sync', testMultibyte, true, execaSync);

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

line 331why, one step back
331

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 332–333why, one step back
332const testMultibytePartial = async (t, objectMode, execaMethod) => {
333 const {stdout} = await execaMethod('stdin.js', {

Fix strings returned by transforms in `objectMode` (#917)ehmickybefore adoption98f403c

lines 334–335why, one step back
334 stdin: [
335 [multibyteUint8Array.slice(0, breakingLength)],

Strip newlines in transforms (#919)ehmickybefore adoption26e9150

line 336why, one step back
336 noopGenerator(objectMode, true),

Fix strings returned by transforms in `objectMode` (#917)ehmickybefore adoption98f403c

lines 337–338why, one step back
337 ],
338 });

Rename 2 files with wrong file names (#865)ehmickybefore adoption4bd0fe3

lines 339–341why, one step back
339 t.is(stdout, `${multibyteChar}${brokenSymbol}`);
340};341

Add support for transforms with `execaSync()` (#945)ehmickybefore adoptionc5f9f09

lines 342–358why, one step back
342test('Generator handles partial multibyte characters with Uint8Array', testMultibytePartial, false, execa);
343test('Generator handles partial multibyte characters with Uint8Array, objectMode', testMultibytePartial, true, execa);344test('Generator handles partial multibyte characters with Uint8Array, sync', testMultibytePartial, false, execaSync);345test('Generator handles partial multibyte characters with Uint8Array, objectMode, sync', testMultibytePartial, true, execaSync);346347const testMultibytePartialOutput = async (t, execaMethod) => {348 const {stdout} = await execaMethod('noop.js', {349 stdout: getOutputsGenerator([350 multibyteUint8Array.slice(0, breakingLength),351 multibyteUint8Array.slice(breakingLength),352 ])(false, true),353 });354 t.is(stdout, multibyteString);355};356357test('Generator handles output multibyte characters with Uint8Array', testMultibytePartialOutput, execa);358test('Generator handles output multibyte characters with Uint8Array, sync', testMultibytePartialOutput, execaSync);