stdio.test-d.ts
This file
Path
test-d/subprocess/stdio.test-d.ts
104 lines · 5.5 KiB · TypeScript
Last changed by
Fix `execaNode()` and the `node` option missing IPC in their typesSindre Sorhusbefore adoption2633abb
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 type {Readable, Writable} from 'node:stream';Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 2why, one step back2import {expectTypeOf} from 'nz';Fix `execaNode()` and the `node` option missing IPC in their typesSindre Sorhusbefore adoption2633abb
line 3why, one step back3import {execa, execaNode, type Subprocess} from '../../index.js';100% test coverage (#1018)ehmickybefore adoption9f65b86
line 4why, one step back4Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 5–8why, one step back5expectTypeOf<Subprocess['stdin']>().toBe<Writable | null>();6expectTypeOf<Subprocess['stdout']>().toBe<Readable | null>();7expectTypeOf<Subprocess['stderr']>().toBe<Readable | null>();8expectTypeOf<Subprocess['all']>().toBe<Readable | undefined>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 9–10why, one step back910const bufferSubprocess = execa('unicorns', {encoding: 'buffer', all: true});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 11–18why, one step back11expectTypeOf(bufferSubprocess.stdin).toBe<Writable>();12expectTypeOf(bufferSubprocess.stdio[0]).toBe<Writable>();13expectTypeOf(bufferSubprocess.stdout).toBe<Readable>();14expectTypeOf(bufferSubprocess.stdio[1]).toBe<Readable>();15expectTypeOf(bufferSubprocess.stderr).toBe<Readable>();16expectTypeOf(bufferSubprocess.stdio[2]).toBe<Readable>();17expectTypeOf(bufferSubprocess.all).toBe<Readable>();18expectTypeOf(bufferSubprocess.stdio[0]).toBe<Writable>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 19–20why, one step back1920const hexSubprocess = execa('unicorns', {encoding: 'hex', all: true});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 21–28why, one step back21expectTypeOf(hexSubprocess.stdin).toBe<Writable>();22expectTypeOf(hexSubprocess.stdio[0]).toBe<Writable>();23expectTypeOf(hexSubprocess.stdout).toBe<Readable>();24expectTypeOf(hexSubprocess.stdio[1]).toBe<Readable>();25expectTypeOf(hexSubprocess.stderr).toBe<Readable>();26expectTypeOf(hexSubprocess.stdio[2]).toBe<Readable>();27expectTypeOf(hexSubprocess.all).toBe<Readable>();28expectTypeOf(hexSubprocess.stdio[0]).toBe<Writable>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 29–30why, one step back2930const multipleStdinSubprocess = execa('unicorns', {stdin: ['inherit', 'pipe']});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 31why, one step back31expectTypeOf(multipleStdinSubprocess.stdin).toBe<Writable>();100% test coverage (#1018)ehmickybefore adoption9f65b86
lines 32–33why, one step back3233const multipleStdoutSubprocess = execa('unicorns', {stdout: ['inherit', 'pipe'] as ['inherit', 'pipe'], all: true});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 34–41why, one step back34expectTypeOf(multipleStdoutSubprocess.stdin).toBe<Writable>();35expectTypeOf(multipleStdoutSubprocess.stdio[0]).toBe<Writable>();36expectTypeOf(multipleStdoutSubprocess.stdout).toBe<Readable>();37expectTypeOf(multipleStdoutSubprocess.stdio[1]).toBe<Readable>();38expectTypeOf(multipleStdoutSubprocess.stderr).toBe<Readable>();39expectTypeOf(multipleStdoutSubprocess.stdio[2]).toBe<Readable>();40expectTypeOf(multipleStdoutSubprocess.all).toBe<Readable>();41expectTypeOf(multipleStdoutSubprocess.stdio[0]).toBe<Writable>();Add `{value: 'pipe', input: true}` to use an additional file descriptor as input (#1246)Sindre Sorhusbefore adoption487a3a4
lines 42–43why, one step back4243const inputPipeSubprocess = execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', {value: 'pipe', input: true}]});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 44why, one step back44expectTypeOf(inputPipeSubprocess.stdio[3]).toBe<Writable>();Add `{value: 'pipe', input: true}` to use an additional file descriptor as input (#1246)Sindre Sorhusbefore adoption487a3a4
lines 45–46why, one step back4546const outputPipeSubprocess = execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', {value: 'pipe'}]});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 47why, one step back47expectTypeOf(outputPipeSubprocess.stdio[3]).toBe<Readable>();Add `{value: 'pipe', input: true}` to use an additional file descriptor as input (#1246)Sindre Sorhusbefore adoption487a3a4
line 48why, one step back48Generalize `{value, input}` to any direction-ambiguous stdio value (#1249)Sindre Sorhusbefore adoption9fbf5ba
line 49why, one step back49const inputInheritSubprocess = execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', {value: 'inherit', input: true}]});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 50why, one step back50expectTypeOf(inputInheritSubprocess.stdio[3]).toBe<null>();Generalize `{value, input}` to any direction-ambiguous stdio value (#1249)Sindre Sorhusbefore adoption9fbf5ba
lines 51–52why, one step back5152const inputFdSubprocess = execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', {value: 3, input: true}]});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 53why, one step back53expectTypeOf(inputFdSubprocess.stdio[3]).toBe<null>();Generalize `{value, input}` to any direction-ambiguous stdio value (#1249)Sindre Sorhusbefore adoption9fbf5ba
lines 54–55why, one step back5455const inputFileSubprocess = execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', {value: {file: './example'}, input: true}]});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 56why, one step back56expectTypeOf(inputFileSubprocess.stdio[3]).toBe<Writable>();Generalize `{value, input}` to any direction-ambiguous stdio value (#1249)Sindre Sorhusbefore adoption9fbf5ba
line 57why, one step back57Update dev dependencies (#1257)Sindre Sorhusbefore adoption5944b2d
lines 58–59why, one step back58const isInput = true as boolean;59const booleanInputPipeSubprocess = execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', {value: 'pipe', input: isInput}]});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 60why, one step back60expectTypeOf(booleanInputPipeSubprocess.stdio[3]).toBe<Readable | Writable>();Add `{value: 'pipe', input: true}` to use an additional file descriptor as input (#1246)Sindre Sorhusbefore adoption487a3a4
line 61why, one step back61Update dev dependencies (#1257)Sindre Sorhusbefore adoption5944b2d
line 62why, one step back62const optionalInputPipe: {readonly value: 'pipe'; readonly input?: boolean} = {value: 'pipe', input: isInput};Add `{value: 'pipe', input: true}` to use an additional file descriptor as input (#1246)Sindre Sorhusbefore adoption487a3a4
line 63why, one step back63const optionalInputPipeSubprocess = execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', optionalInputPipe]});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 64why, one step back64expectTypeOf(optionalInputPipeSubprocess.stdio[3]).toBe<Readable | Writable>();Add `{value: 'pipe', input: true}` to use an additional file descriptor as input (#1246)Sindre Sorhusbefore adoption487a3a4
lines 65–67why, one step back6566const optionalTrueInputPipe: {readonly value: 'pipe'; readonly input?: true} = {value: 'pipe', input: true};67const optionalTrueInputPipeSubprocess = execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', optionalTrueInputPipe]});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 68why, one step back68expectTypeOf(optionalTrueInputPipeSubprocess.stdio[3]).toBe<Readable | Writable>();Add `{value: 'pipe', input: true}` to use an additional file descriptor as input (#1246)Sindre Sorhusbefore adoption487a3a4
lines 69–70why, one step back6970const stdoutInputPipeSubprocess = execa('unicorns', {stdout: {value: 'pipe', input: true}});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 71–72why, one step back71expectTypeOf(stdoutInputPipeSubprocess.stdout).toBe<Readable>();72expectTypeOf(stdoutInputPipeSubprocess.stdio[1]).toBe<Readable>();Add `{value: 'pipe', input: true}` to use an additional file descriptor as input (#1246)Sindre Sorhusbefore adoption487a3a4
lines 73–74why, one step back7374const stderrInputPipeSubprocess = execa('unicorns', {stderr: {value: 'pipe', input: true}});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 75–76why, one step back75expectTypeOf(stderrInputPipeSubprocess.stderr).toBe<Readable>();76expectTypeOf(stderrInputPipeSubprocess.stdio[2]).toBe<Readable>();Fix documentation and types mistakesSindre Sorhusbefore adoption74b854a
lines 77–78why, one step back7778const noIpcSubprocess = execa('unicorns');Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 79–81why, one step back79expectTypeOf(noIpcSubprocess.stdio[0]).toBe<Writable>();80expectTypeOf(noIpcSubprocess.stdio[1]).toBe<Readable>();81expectTypeOf(noIpcSubprocess.stdio[2]).toBe<Readable>();Fix documentation and types mistakesSindre Sorhusbefore adoption74b854a
lines 82–83why, one step back8283const ipcSubprocess = execa('unicorns', {ipc: true});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 84–87why, one step back84expectTypeOf(ipcSubprocess.stdio[0]).toBe<Writable>();85expectTypeOf(ipcSubprocess.stdio[1]).toBe<Readable>();86expectTypeOf(ipcSubprocess.stdio[2]).toBe<Readable>();87expectTypeOf(ipcSubprocess.stdio[3]).toBe<null>();Fix documentation and types mistakesSindre Sorhusbefore adoption74b854a
lines 88–89why, one step back8889const ipcInputSubprocess = execa('unicorns', {ipcInput: ''});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 90why, one step back90expectTypeOf(ipcInputSubprocess.stdio[3]).toBe<null>();Fix `execaNode()` and the `node` option missing IPC in their typesSindre Sorhusbefore adoption2633abb
lines 91–93why, one step back9192const execaNodeSubprocess = execaNode('unicorns');93expectTypeOf(execaNodeSubprocess.stdio[3]).toBe<null>();Fix documentation and types mistakesSindre Sorhusbefore adoption74b854a
lines 94–95why, one step back9495const fd3IpcSubprocess = execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe'], ipc: true});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 96–97why, one step back96expectTypeOf(fd3IpcSubprocess.stdio[3]).toBe<Readable>();97expectTypeOf(fd3IpcSubprocess.stdio[4]).toBe<null>();Fix documentation and types mistakesSindre Sorhusbefore adoption74b854a
lines 98–99why, one step back9899const fd5IpcSubprocess = execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe', 'pipe'], ipc: true});Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
lines 100–102why, one step back100expectTypeOf(fd5IpcSubprocess.stdio[5]).toBe<Readable>();101expectTypeOf(fd5IpcSubprocess.stdio[6]).toBe<null>();102expectTypeOf(fd5IpcSubprocess.stdio[7]).toBe<Readable | Writable | null>();Fix documentation and types mistakesSindre Sorhusbefore adoption74b854a
line 103why, one step back103Move type tests from `tsd` to `nz`Sindre Sorhusbefore adoption2141147
line 104why, one step back104expectTypeOf(noIpcSubprocess.stdio[3]).toBe<Readable | Writable | null>();