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 fileTake it
The walk stopped after 200 commits: lines older than 9f65b86 point at it.
100% test coverage (#1018)ehmickybefore adoption9f65b86
line 1why, one step back1import {createWriteStream} from 'node:fs';Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c
line 2why, one step back2import type {Readable} from 'node:stream';Add `.readableStream()`, `.writableStream()` and `.transformStream()` methods (#1254)Sindre Sorhusbefore adoption29d9cfc
line 3why, one step back3import type {ReadableStream} from 'node:stream/web';Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 4why, one step back4import {expectTypeOf, expectError} from 'nz';100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 5–9why, one step back5import {6 execa,7 execaSync,8 $,9 type Result,Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c
line 10why, one step back10 type Message,100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 11–25why, one step back11} 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>;25Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 26–31why, one step back26expectTypeOf(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 back32Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 33–36why, one step back33expectTypeOf(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 back37Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 38–41why, one step back38expectTypeOf(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 back42Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 43–48why, one step back43expectTypeOf(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 back49Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 50–55why, one step back50expectTypeOf(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 back56Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 57–62why, one step back57expectTypeOf(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 back63Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 64–69why, one step back64expectTypeOf(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 back70Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 71–76why, one step back71expectTypeOf(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 back77Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 78–83why, one step back78expectTypeOf(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 back84Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 85–90why, one step back85expectTypeOf(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 back91Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 92–97why, one step back92expectTypeOf(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 back98Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 99–104why, one step back99expectTypeOf(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 back105106await 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}));205Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 206why, one step back206expectTypeOf(await subprocess.pipe('stdin')).toBe<EmptyExecaReturnValue>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 207–236why, one step back207await 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 back237expectTypeOf(pipeResult.stdout).toBe<string>();100% test coverage (#1018)ehmickybefore adoption9f65b86
line 238why, one step back238const ignorePipeResult = await subprocess.pipe({stdout: 'ignore'})`stdin`;Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 239why, one step back239expectTypeOf(ignorePipeResult.stdout).toBe<undefined>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 240–241why, one step back240241const scriptPipeResult = await scriptSubprocess.pipe`stdin`;Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 242why, one step back242expectTypeOf(scriptPipeResult.stdout).toBe<string>();100% test coverage (#1018)ehmickybefore adoption9f65b86
line 243why, one step back243const ignoreScriptPipeResult = await scriptSubprocess.pipe({stdout: 'ignore'})`stdin`;Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 244why, one step back244expectTypeOf(ignoreScriptPipeResult.stdout).toBe<undefined>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 245–246why, one step back245246const shortcutPipeResult = await subprocess.pipe('stdin');Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 247why, one step back247expectTypeOf(shortcutPipeResult.stdout).toBe<string>();100% test coverage (#1018)ehmickybefore adoption9f65b86
line 248why, one step back248const ignoreShortcutPipeResult = await subprocess.pipe('stdin', {stdout: 'ignore'});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 249why, one step back249expectTypeOf(ignoreShortcutPipeResult.stdout).toBe<undefined>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 250–251why, one step back250251const scriptShortcutPipeResult = await scriptSubprocess.pipe('stdin');Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 252why, one step back252expectTypeOf(scriptShortcutPipeResult.stdout).toBe<string>();100% test coverage (#1018)ehmickybefore adoption9f65b86
line 253why, one step back253const ignoreShortcutScriptPipeResult = await scriptSubprocess.pipe('stdin', {stdout: 'ignore'});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 254why, one step back254expectTypeOf(ignoreShortcutScriptPipeResult.stdout).toBe<undefined>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 255–257why, one step back255256const unicornsResult = execaSync('unicorns');257expectError(unicornsResult.pipe);Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c
lines 258–260why, one step back258259// 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 back261 expectTypeOf(pipeLine).toBe<string>();Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c
lines 262–264why, one step back262}263264for await (const pipeLine of subprocess.pipe`stdin`.iterable()) {Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 265why, one step back265 expectTypeOf(pipeLine).toBe<string>();Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c
lines 266–268why, one step back266}267268for await (const pipeLine of subprocess.pipe(bufferSubprocess)) {Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 269why, one step back269 expectTypeOf(pipeLine).toBe<Uint8Array>();Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c
lines 270–271why, one step back270}271Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 272–273why, one step back272expectTypeOf(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 back274Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 275–276why, one step back275expectTypeOf(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 back277Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 278why, one step back278expectTypeOf(subprocess.pipe`stdin`.sendMessage).toBe<undefined>();Expose the destination subprocess methods on `.pipe()` (#1252)Sindre Sorhusbefore adoptionc31c94c
line 279why, one step back279const ipcPipeResult = subprocess.pipe({ipc: true})`stdin`;Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 280–282why, one step back280expectTypeOf(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 back283Add `.readableStream()`, `.writableStream()` and `.transformStream()` methods (#1254)Sindre Sorhusbefore adoption29d9cfc
line 284why, one step back284// `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 back285expectError(subprocess.pipe`stdin`.writable());286expectError(subprocess.pipe`stdin`.duplex());Add `.readableStream()`, `.writableStream()` and `.transformStream()` methods (#1254)Sindre Sorhusbefore adoption29d9cfc
lines 287–288why, one step back287expectError(subprocess.pipe`stdin`.writableStream());288expectError(subprocess.pipe`stdin`.transformStream());