Skip to content
Myr

pipe.test-d.ts

This file

Path

test-d/pipe.test-d.ts

288 lines · 16.4 KiB · TypeScript

Last changed by

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

History of this file

Take it

The walk stopped after 200 commits: lines older than 9f65b86 point at it.

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 1why, one step back
1import {createWriteStream} from 'node:fs';

Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c

line 2why, one step back
2import type {Readable} from 'node:stream';

Add `.readableStream()`, `.writableStream()` and `.transformStream()` methods (#1254)Sindre Sorhusbefore adoption29d9cfc

line 3why, one step back
3import type {ReadableStream} from 'node:stream/web';

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 4why, one step back
4import {expectTypeOf, expectError} from 'nz';

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 5–9why, one step back
5import {
6 execa,7 execaSync,8 $,9 type Result,

Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c

line 10why, one step back
10 type Message,

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 11–25why, one step back
11} from '../index.js';
1213const fileUrl = new URL('file:///test');14const stringArray = ['foo', 'bar'] as const;15const pipeOptions = {from: 'stderr', to: 'fd3', all: true} as const;1617const subprocess = execa('unicorns', {all: true});18const bufferSubprocess = execa('unicorns', {encoding: 'buffer', all: true});19const scriptSubprocess = $`unicorns`;2021const bufferResult = await bufferSubprocess;22type BufferExecaReturnValue = typeof bufferResult;23type EmptyExecaReturnValue = Result<{}>;24type ShortcutExecaReturnValue = Result<typeof pipeOptions>;25

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 26–31why, one step back
26expectTypeOf(await subprocess.pipe(subprocess)).not.toBe<BufferExecaReturnValue>();
27expectTypeOf(await scriptSubprocess.pipe(subprocess)).not.toBe<BufferExecaReturnValue>();28expectTypeOf(await subprocess.pipe(bufferSubprocess)).toBe<BufferExecaReturnValue>();29expectTypeOf(await scriptSubprocess.pipe(bufferSubprocess)).toBe<BufferExecaReturnValue>();30expectTypeOf(await subprocess.pipe(bufferSubprocess, pipeOptions)).toBe<BufferExecaReturnValue>();31expectTypeOf(await scriptSubprocess.pipe(bufferSubprocess, pipeOptions)).toBe<BufferExecaReturnValue>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 32why, one step back
32

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 33–36why, one step back
33expectTypeOf(await subprocess.pipe`stdin`).toBe<EmptyExecaReturnValue>();
34expectTypeOf(await scriptSubprocess.pipe`stdin`).toBe<EmptyExecaReturnValue>();35expectTypeOf(await subprocess.pipe(pipeOptions)`stdin`).toBe<ShortcutExecaReturnValue>();36expectTypeOf(await scriptSubprocess.pipe(pipeOptions)`stdin`).toBe<ShortcutExecaReturnValue>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 37why, one step back
37

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 38–41why, one step back
38expectTypeOf(await subprocess.pipe('stdin')).toBe<EmptyExecaReturnValue>();
39expectTypeOf(await scriptSubprocess.pipe('stdin')).toBe<EmptyExecaReturnValue>();40expectTypeOf(await subprocess.pipe('stdin', pipeOptions)).toBe<ShortcutExecaReturnValue>();41expectTypeOf(await scriptSubprocess.pipe('stdin', pipeOptions)).toBe<ShortcutExecaReturnValue>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 42why, one step back
42

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 43–48why, one step back
43expectTypeOf(await subprocess.pipe(subprocess).pipe(bufferSubprocess)).toBe<BufferExecaReturnValue>();
44expectTypeOf(await scriptSubprocess.pipe(subprocess).pipe(bufferSubprocess)).toBe<BufferExecaReturnValue>();45expectTypeOf(await subprocess.pipe(subprocess, pipeOptions).pipe(bufferSubprocess)).toBe<BufferExecaReturnValue>();46expectTypeOf(await scriptSubprocess.pipe(subprocess, pipeOptions).pipe(bufferSubprocess)).toBe<BufferExecaReturnValue>();47expectTypeOf(await subprocess.pipe(subprocess).pipe(bufferSubprocess, pipeOptions)).toBe<BufferExecaReturnValue>();48expectTypeOf(await scriptSubprocess.pipe(subprocess).pipe(bufferSubprocess, pipeOptions)).toBe<BufferExecaReturnValue>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 49why, one step back
49

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 50–55why, one step back
50expectTypeOf(await subprocess.pipe(subprocess).pipe`stdin`).toBe<EmptyExecaReturnValue>();
51expectTypeOf(await scriptSubprocess.pipe(subprocess).pipe`stdin`).toBe<EmptyExecaReturnValue>();52expectTypeOf(await subprocess.pipe(subprocess, pipeOptions).pipe`stdin`).toBe<EmptyExecaReturnValue>();53expectTypeOf(await scriptSubprocess.pipe(subprocess, pipeOptions).pipe`stdin`).toBe<EmptyExecaReturnValue>();54expectTypeOf(await subprocess.pipe(subprocess).pipe(pipeOptions)`stdin`).toBe<ShortcutExecaReturnValue>();55expectTypeOf(await scriptSubprocess.pipe(subprocess).pipe(pipeOptions)`stdin`).toBe<ShortcutExecaReturnValue>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 56why, one step back
56

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 57–62why, one step back
57expectTypeOf(await subprocess.pipe(subprocess).pipe('stdin')).toBe<EmptyExecaReturnValue>();
58expectTypeOf(await scriptSubprocess.pipe(subprocess).pipe('stdin')).toBe<EmptyExecaReturnValue>();59expectTypeOf(await subprocess.pipe(subprocess, pipeOptions).pipe('stdin')).toBe<EmptyExecaReturnValue>();60expectTypeOf(await scriptSubprocess.pipe(subprocess, pipeOptions).pipe('stdin')).toBe<EmptyExecaReturnValue>();61expectTypeOf(await subprocess.pipe(subprocess).pipe('stdin', pipeOptions)).toBe<ShortcutExecaReturnValue>();62expectTypeOf(await scriptSubprocess.pipe(subprocess).pipe('stdin', pipeOptions)).toBe<ShortcutExecaReturnValue>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 63why, one step back
63

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 64–69why, one step back
64expectTypeOf(await subprocess.pipe`stdin`.pipe(bufferSubprocess)).toBe<BufferExecaReturnValue>();
65expectTypeOf(await scriptSubprocess.pipe`stdin`.pipe(bufferSubprocess)).toBe<BufferExecaReturnValue>();66expectTypeOf(await subprocess.pipe(pipeOptions)`stdin`.pipe(bufferSubprocess)).toBe<BufferExecaReturnValue>();67expectTypeOf(await scriptSubprocess.pipe(pipeOptions)`stdin`.pipe(bufferSubprocess)).toBe<BufferExecaReturnValue>();68expectTypeOf(await subprocess.pipe`stdin`.pipe(bufferSubprocess, pipeOptions)).toBe<BufferExecaReturnValue>();69expectTypeOf(await scriptSubprocess.pipe`stdin`.pipe(bufferSubprocess, pipeOptions)).toBe<BufferExecaReturnValue>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 70why, one step back
70

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 71–76why, one step back
71expectTypeOf(await subprocess.pipe`stdin`.pipe`stdin`).toBe<EmptyExecaReturnValue>();
72expectTypeOf(await scriptSubprocess.pipe`stdin`.pipe`stdin`).toBe<EmptyExecaReturnValue>();73expectTypeOf(await subprocess.pipe(pipeOptions)`stdin`.pipe`stdin`).toBe<EmptyExecaReturnValue>();74expectTypeOf(await scriptSubprocess.pipe(pipeOptions)`stdin`.pipe`stdin`).toBe<EmptyExecaReturnValue>();75expectTypeOf(await subprocess.pipe`stdin`.pipe(pipeOptions)`stdin`).toBe<ShortcutExecaReturnValue>();76expectTypeOf(await scriptSubprocess.pipe`stdin`.pipe(pipeOptions)`stdin`).toBe<ShortcutExecaReturnValue>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 77why, one step back
77

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 78–83why, one step back
78expectTypeOf(await subprocess.pipe`stdin`.pipe('stdin')).toBe<EmptyExecaReturnValue>();
79expectTypeOf(await scriptSubprocess.pipe`stdin`.pipe('stdin')).toBe<EmptyExecaReturnValue>();80expectTypeOf(await subprocess.pipe(pipeOptions)`stdin`.pipe('stdin')).toBe<EmptyExecaReturnValue>();81expectTypeOf(await scriptSubprocess.pipe(pipeOptions)`stdin`.pipe('stdin')).toBe<EmptyExecaReturnValue>();82expectTypeOf(await subprocess.pipe`stdin`.pipe('stdin', pipeOptions)).toBe<ShortcutExecaReturnValue>();83expectTypeOf(await scriptSubprocess.pipe`stdin`.pipe('stdin', pipeOptions)).toBe<ShortcutExecaReturnValue>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 84why, one step back
84

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 85–90why, one step back
85expectTypeOf(await subprocess.pipe('pipe').pipe(bufferSubprocess)).toBe<BufferExecaReturnValue>();
86expectTypeOf(await scriptSubprocess.pipe('pipe').pipe(bufferSubprocess)).toBe<BufferExecaReturnValue>();87expectTypeOf(await subprocess.pipe('pipe', pipeOptions).pipe(bufferSubprocess)).toBe<BufferExecaReturnValue>();88expectTypeOf(await scriptSubprocess.pipe('pipe', pipeOptions).pipe(bufferSubprocess)).toBe<BufferExecaReturnValue>();89expectTypeOf(await subprocess.pipe('pipe').pipe(bufferSubprocess, pipeOptions)).toBe<BufferExecaReturnValue>();90expectTypeOf(await scriptSubprocess.pipe('pipe').pipe(bufferSubprocess, pipeOptions)).toBe<BufferExecaReturnValue>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 91why, one step back
91

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 92–97why, one step back
92expectTypeOf(await subprocess.pipe('pipe').pipe`stdin`).toBe<EmptyExecaReturnValue>();
93expectTypeOf(await scriptSubprocess.pipe('pipe').pipe`stdin`).toBe<EmptyExecaReturnValue>();94expectTypeOf(await subprocess.pipe('pipe', pipeOptions).pipe`stdin`).toBe<EmptyExecaReturnValue>();95expectTypeOf(await scriptSubprocess.pipe('pipe', pipeOptions).pipe`stdin`).toBe<EmptyExecaReturnValue>();96expectTypeOf(await subprocess.pipe('pipe').pipe(pipeOptions)`stdin`).toBe<ShortcutExecaReturnValue>();97expectTypeOf(await scriptSubprocess.pipe('pipe').pipe(pipeOptions)`stdin`).toBe<ShortcutExecaReturnValue>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 98why, one step back
98

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 99–104why, one step back
99expectTypeOf(await subprocess.pipe('pipe').pipe('stdin')).toBe<EmptyExecaReturnValue>();
100expectTypeOf(await scriptSubprocess.pipe('pipe').pipe('stdin')).toBe<EmptyExecaReturnValue>();101expectTypeOf(await subprocess.pipe('pipe', pipeOptions).pipe('stdin')).toBe<EmptyExecaReturnValue>();102expectTypeOf(await scriptSubprocess.pipe('pipe', pipeOptions).pipe('stdin')).toBe<EmptyExecaReturnValue>();103expectTypeOf(await subprocess.pipe('pipe').pipe('stdin', pipeOptions)).toBe<ShortcutExecaReturnValue>();104expectTypeOf(await scriptSubprocess.pipe('pipe').pipe('stdin', pipeOptions)).toBe<ShortcutExecaReturnValue>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 105–205why, one step back
105
106await subprocess.pipe(bufferSubprocess, {});107await scriptSubprocess.pipe(bufferSubprocess, {});108await subprocess.pipe({})`stdin`;109await scriptSubprocess.pipe({})`stdin`;110await subprocess.pipe('stdin', {});111await scriptSubprocess.pipe('stdin', {});112113expectError(subprocess.pipe(bufferSubprocess).stdout);114expectError(scriptSubprocess.pipe(bufferSubprocess).stdout);115expectError(subprocess.pipe`stdin`.stdout);116expectError(scriptSubprocess.pipe`stdin`.stdout);117expectError(subprocess.pipe('stdin').stdout);118expectError(scriptSubprocess.pipe('stdin').stdout);119120expectError(await subprocess.pipe({})({}));121expectError(await scriptSubprocess.pipe({})({}));122expectError(await subprocess.pipe({})(subprocess));123expectError(await scriptSubprocess.pipe({})(subprocess));124expectError(await subprocess.pipe({})('stdin'));125expectError(await scriptSubprocess.pipe({})('stdin'));126127expectError(subprocess.pipe(createWriteStream('output.txt')));128expectError(scriptSubprocess.pipe(createWriteStream('output.txt')));129expectError(subprocess.pipe(false));130expectError(scriptSubprocess.pipe(false));131132expectError(subprocess.pipe(bufferSubprocess, 'stdout'));133expectError(scriptSubprocess.pipe(bufferSubprocess, 'stdout'));134expectError(subprocess.pipe('stdout')`stdin`);135expectError(scriptSubprocess.pipe('stdout')`stdin`);136137await subprocess.pipe(bufferSubprocess, {from: 'stdout'});138await scriptSubprocess.pipe(bufferSubprocess, {from: 'stdout'});139await subprocess.pipe({from: 'stdout'})`stdin`;140await scriptSubprocess.pipe({from: 'stdout'})`stdin`;141await subprocess.pipe('stdin', {from: 'stdout'});142await scriptSubprocess.pipe('stdin', {from: 'stdout'});143144await subprocess.pipe(bufferSubprocess, {from: 'stderr'});145await scriptSubprocess.pipe(bufferSubprocess, {from: 'stderr'});146await subprocess.pipe({from: 'stderr'})`stdin`;147await scriptSubprocess.pipe({from: 'stderr'})`stdin`;148await subprocess.pipe('stdin', {from: 'stderr'});149await scriptSubprocess.pipe('stdin', {from: 'stderr'});150151await subprocess.pipe(bufferSubprocess, {from: 'all'});152await scriptSubprocess.pipe(bufferSubprocess, {from: 'all'});153await subprocess.pipe({from: 'all'})`stdin`;154await scriptSubprocess.pipe({from: 'all'})`stdin`;155await subprocess.pipe('stdin', {from: 'all'});156await scriptSubprocess.pipe('stdin', {from: 'all'});157158await subprocess.pipe(bufferSubprocess, {from: 'fd3'});159await scriptSubprocess.pipe(bufferSubprocess, {from: 'fd3'});160await subprocess.pipe({from: 'fd3'})`stdin`;161await scriptSubprocess.pipe({from: 'fd3'})`stdin`;162await subprocess.pipe('stdin', {from: 'fd3'});163await scriptSubprocess.pipe('stdin', {from: 'fd3'});164165expectError(subprocess.pipe(bufferSubprocess, {from: 'stdin'}));166expectError(scriptSubprocess.pipe(bufferSubprocess, {from: 'stdin'}));167expectError(subprocess.pipe({from: 'stdin'})`stdin`);168expectError(scriptSubprocess.pipe({from: 'stdin'})`stdin`);169expectError(subprocess.pipe('stdin', {from: 'stdin'}));170expectError(scriptSubprocess.pipe('stdin', {from: 'stdin'}));171172await subprocess.pipe(bufferSubprocess, {to: 'stdin'});173await scriptSubprocess.pipe(bufferSubprocess, {to: 'stdin'});174await subprocess.pipe({to: 'stdin'})`stdin`;175await scriptSubprocess.pipe({to: 'stdin'})`stdin`;176await subprocess.pipe('stdin', {to: 'stdin'});177await scriptSubprocess.pipe('stdin', {to: 'stdin'});178179await subprocess.pipe(bufferSubprocess, {to: 'fd3'});180await scriptSubprocess.pipe(bufferSubprocess, {to: 'fd3'});181await subprocess.pipe({to: 'fd3'})`stdin`;182await scriptSubprocess.pipe({to: 'fd3'})`stdin`;183await subprocess.pipe('stdin', {to: 'fd3'});184await scriptSubprocess.pipe('stdin', {to: 'fd3'});185186expectError(subprocess.pipe(bufferSubprocess, {to: 'stdout'}));187expectError(scriptSubprocess.pipe(bufferSubprocess, {to: 'stdout'}));188expectError(subprocess.pipe({to: 'stdout'})`stdin`);189expectError(scriptSubprocess.pipe({to: 'stdout'})`stdin`);190expectError(subprocess.pipe('stdin', {to: 'stdout'}));191expectError(scriptSubprocess.pipe('stdin', {to: 'stdout'}));192193await subprocess.pipe(bufferSubprocess, {unpipeSignal: new AbortController().signal});194await scriptSubprocess.pipe(bufferSubprocess, {unpipeSignal: new AbortController().signal});195await subprocess.pipe({unpipeSignal: new AbortController().signal})`stdin`;196await scriptSubprocess.pipe({unpipeSignal: new AbortController().signal})`stdin`;197await subprocess.pipe('stdin', {unpipeSignal: new AbortController().signal});198await scriptSubprocess.pipe('stdin', {unpipeSignal: new AbortController().signal});199expectError(await subprocess.pipe(bufferSubprocess, {unpipeSignal: true}));200expectError(await scriptSubprocess.pipe(bufferSubprocess, {unpipeSignal: true}));201expectError(await subprocess.pipe({unpipeSignal: true})`stdin`);202expectError(await scriptSubprocess.pipe({unpipeSignal: true})`stdin`);203expectError(await subprocess.pipe('stdin', {unpipeSignal: true}));204expectError(await scriptSubprocess.pipe('stdin', {unpipeSignal: true}));205

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 206why, one step back
206expectTypeOf(await subprocess.pipe('stdin')).toBe<EmptyExecaReturnValue>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 207–236why, one step back
207await subprocess.pipe('stdin');
208await subprocess.pipe(fileUrl);209await subprocess.pipe('stdin', []);210await subprocess.pipe('stdin', stringArray);211await subprocess.pipe('stdin', stringArray, {});212await subprocess.pipe('stdin', stringArray, {from: 'stderr', to: 'stdin', all: true});213await subprocess.pipe('stdin', {from: 'stderr'});214await subprocess.pipe('stdin', {to: 'stdin'});215await subprocess.pipe('stdin', {all: true});216217expectError(await subprocess.pipe(stringArray));218expectError(await subprocess.pipe('stdin', 'foo'));219expectError(await subprocess.pipe('stdin', [false]));220expectError(await subprocess.pipe('stdin', [], false));221expectError(await subprocess.pipe('stdin', {other: true}));222expectError(await subprocess.pipe('stdin', [], {other: true}));223expectError(await subprocess.pipe('stdin', {from: 'fd'}));224expectError(await subprocess.pipe('stdin', [], {from: 'fd'}));225expectError(await subprocess.pipe('stdin', {from: 'fdNotANumber'}));226expectError(await subprocess.pipe('stdin', [], {from: 'fdNotANumber'}));227expectError(await subprocess.pipe('stdin', {from: 'other'}));228expectError(await subprocess.pipe('stdin', [], {from: 'other'}));229expectError(await subprocess.pipe('stdin', {to: 'fd'}));230expectError(await subprocess.pipe('stdin', [], {to: 'fd'}));231expectError(await subprocess.pipe('stdin', {to: 'fdNotANumber'}));232expectError(await subprocess.pipe('stdin', [], {to: 'fdNotANumber'}));233expectError(await subprocess.pipe('stdin', {to: 'other'}));234expectError(await subprocess.pipe('stdin', [], {to: 'other'}));235236const pipeResult = await subprocess.pipe`stdin`;

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 237why, one step back
237expectTypeOf(pipeResult.stdout).toBe<string>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 238why, one step back
238const ignorePipeResult = await subprocess.pipe({stdout: 'ignore'})`stdin`;

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 239why, one step back
239expectTypeOf(ignorePipeResult.stdout).toBe<undefined>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 240–241why, one step back
240
241const scriptPipeResult = await scriptSubprocess.pipe`stdin`;

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 242why, one step back
242expectTypeOf(scriptPipeResult.stdout).toBe<string>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 243why, one step back
243const ignoreScriptPipeResult = await scriptSubprocess.pipe({stdout: 'ignore'})`stdin`;

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 244why, one step back
244expectTypeOf(ignoreScriptPipeResult.stdout).toBe<undefined>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 245–246why, one step back
245
246const shortcutPipeResult = await subprocess.pipe('stdin');

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 247why, one step back
247expectTypeOf(shortcutPipeResult.stdout).toBe<string>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 248why, one step back
248const ignoreShortcutPipeResult = await subprocess.pipe('stdin', {stdout: 'ignore'});

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 249why, one step back
249expectTypeOf(ignoreShortcutPipeResult.stdout).toBe<undefined>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 250–251why, one step back
250
251const scriptShortcutPipeResult = await scriptSubprocess.pipe('stdin');

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 252why, one step back
252expectTypeOf(scriptShortcutPipeResult.stdout).toBe<string>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

line 253why, one step back
253const ignoreShortcutScriptPipeResult = await scriptSubprocess.pipe('stdin', {stdout: 'ignore'});

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 254why, one step back
254expectTypeOf(ignoreShortcutScriptPipeResult.stdout).toBe<undefined>();

100% test coverage (#1018)ehmickybefore adoption9f65b86

lines 255–257why, one step back
255
256const unicornsResult = execaSync('unicorns');257expectError(unicornsResult.pipe);

Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c

lines 258–260why, one step back
258
259// The `.pipe()` return value forwards the destination subprocess' iteration, stream conversion and IPC methods.260for await (const pipeLine of subprocess.pipe`stdin`) {

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 261why, one step back
261 expectTypeOf(pipeLine).toBe<string>();

Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c

lines 262–264why, one step back
262}
263264for await (const pipeLine of subprocess.pipe`stdin`.iterable()) {

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 265why, one step back
265 expectTypeOf(pipeLine).toBe<string>();

Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c

lines 266–268why, one step back
266}
267268for await (const pipeLine of subprocess.pipe(bufferSubprocess)) {

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 269why, one step back
269 expectTypeOf(pipeLine).toBe<Uint8Array>();

Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c

lines 270–271why, one step back
270}
271

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 272–273why, one step back
272expectTypeOf(subprocess.pipe`stdin`.readable()).toBe<Readable>();
273expectTypeOf(subprocess.pipe`stdin`.readableStream()).toBe<ReadableStream>();

Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c

line 274why, one step back
274

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 275–276why, one step back
275expectTypeOf(subprocess.pipe({all: true})`stdin`.all).toBe<Readable>();
276expectTypeOf(subprocess.pipe`stdin`.all).toBe<undefined>();

Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c

line 277why, one step back
277

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

line 278why, one step back
278expectTypeOf(subprocess.pipe`stdin`.sendMessage).toBe<undefined>();

Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c

line 279why, one step back
279const ipcPipeResult = subprocess.pipe({ipc: true})`stdin`;

Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147

lines 280–282why, one step back
280expectTypeOf(ipcPipeResult.sendMessage('message')).toBe<Promise<void>>();
281expectTypeOf(ipcPipeResult.getOneMessage()).toBe<Promise<Message<'advanced'>>>();282expectTypeOf(ipcPipeResult.getEachMessage()).toBe<AsyncIterableIterator<Message<'advanced'>>>();

Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c

line 283why, one step back
283

Add `.readableStream()`, `.writableStream()` and `.transformStream()` methods (#1254)Sindre Sorhusbefore adoption29d9cfc

line 284why, one step back
284// `writable()`, `duplex()`, `writableStream()` and `transformStream()` write to the destination's `stdin`, which is already piped from the source, so they are not forwarded.

Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c

lines 285–286why, one step back
285expectError(subprocess.pipe`stdin`.writable());
286expectError(subprocess.pipe`stdin`.duplex());

Add `.readableStream()`, `.writableStream()` and `.transformStream()` methods (#1254)Sindre Sorhusbefore adoption29d9cfc

lines 287–288why, one step back
287expectError(subprocess.pipe`stdin`.writableStream());
288expectError(subprocess.pipe`stdin`.transformStream());