Skip to content
Myr

Fix types of `execaSync()` (#939)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ehmicky · committed by GitHub · parent 45824d6 · Browse files · 2 files+156 added−143 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+156 added−143 removed

  • other:+156 added−143 removed

2 files+156 added−143 removed

modified:index.d.ts+75 added-45 removed
1import {type ChildProcess} from 'node:child_process';2import {type Readable, type Writable, type Duplex} from 'node:stream';34type IfAsync<IsSync extends boolean, AsyncValue, SyncValue = never> = IsSync extends true ? SyncValue : AsyncValue;4type And<First extends boolean, Second extends boolean> = First extends true ? Second : false;56type Or<First extends boolean, Second extends boolean> = First extends true ? true : Second;78type Unless<Condition extends boolean, ThenValue, ElseValue = never> = Condition extends true ? ElseValue : ThenValue;910// When the `stdin`/`stdout`/`stderr`/`stdio` option is set to one of those values, no stream is created11type NoStreamStdioOption =12 | 'ignore'13 | 'inherit'
2 unmodified lines
16 | Readable17 | Writable18 | [NoStreamStdioOption];1916type BaseStdioOption =20type BaseStdioOption<21 IsSync extends boolean = boolean,22 IsArray extends boolean = boolean,23> =24 | 'pipe'18 | 'overlapped'19 | 'ignore'20 | 'inherit';25 | undefined26 | Unless<And<IsSync, IsArray>, 'inherit'>27 | Unless<IsArray, 'ignore'>28 | Unless<IsSync, 'overlapped'>;2930// @todo Use `string`, `Uint8Array` or `unknown` for both the argument and the return type, based on whether `encoding: 'buffer'` and `objectMode: true` are used.31// See https://github.com/sindresorhus/execa/issues/69432type GeneratorTransform = (chunk: unknown) => AsyncGenerator<unknown, void, void> | Generator<unknown, void, void>;
16 unmodified lines
49 transform: TransformStream;50 objectMode?: boolean;51};5245type CommonStdioOption<IsSync extends boolean = boolean> =46 | BaseStdioOption47 | 'ipc'48 | number49 | undefined53type CommonStdioOption<54 IsSync extends boolean = boolean,55 IsArray extends boolean = boolean,56> =57 | BaseStdioOption<IsSync, IsArray>58 | URL59 | {file: string}60 | Unless<And<IsSync, IsArray>, number>61 | Unless<Or<IsSync, IsArray>, 'ipc'>52 | IfAsync<IsSync,62 | Unless<IsSync,63 | GeneratorTransform64 | GeneratorTransformFull65 | DuplexTransform66 | WebTransform67 | TransformStream>;6859type InputStdioOption<IsSync extends boolean = boolean> =69type InputStdioOption<70 IsSync extends boolean = boolean,71 IsArray extends boolean = boolean,72> =73 | Uint8Array61 | Readable62 | IfAsync<IsSync,74 | Unless<And<IsSync, IsArray>, Readable>75 | Unless<IsSync,76 | Iterable<unknown>77 | AsyncIterable<unknown>78 | ReadableStream>;7967type OutputStdioOption<IsSync extends boolean = boolean> =68 | Writable69 | IfAsync<IsSync, WritableStream>;80type OutputStdioOption<81 IsSync extends boolean = boolean,82 IsArray extends boolean = boolean,83> =84 | Unless<And<IsSync, IsArray>, Writable>85 | Unless<IsSync, WritableStream>;8671type StdinSingleOption<IsSync extends boolean = boolean> =72 | CommonStdioOption<IsSync>73 | InputStdioOption<IsSync>;87type StdinSingleOption<88 IsSync extends boolean = boolean,89 IsArray extends boolean = boolean,90> =91 | CommonStdioOption<IsSync, IsArray>92 | InputStdioOption<IsSync, IsArray>;9394export type StdinOption<IsSync extends boolean = boolean> =75 | StdinSingleOption<IsSync>76 | Array<StdinSingleOption<IsSync>>;77type StdoutStderrSingleOption<IsSync extends boolean = boolean> =78 | CommonStdioOption<IsSync>79 | OutputStdioOption<IsSync>;95 | StdinSingleOption<IsSync, false>96 | Array<StdinSingleOption<IsSync, true>>;9798type StdoutStderrSingleOption<99 IsSync extends boolean = boolean,100 IsArray extends boolean = boolean,101> =102 | CommonStdioOption<IsSync, IsArray>103 | OutputStdioOption<IsSync, IsArray>;104105export type StdoutStderrOption<IsSync extends boolean = boolean> =81 | StdoutStderrSingleOption<IsSync>82 | Array<StdoutStderrSingleOption<IsSync>>;83type StdioSingleOption<IsSync extends boolean = boolean> =84 | CommonStdioOption<IsSync>85 | InputStdioOption<IsSync>86 | OutputStdioOption<IsSync>;106 | StdoutStderrSingleOption<IsSync, false>107 | Array<StdoutStderrSingleOption<IsSync, true>>;108109type StdioSingleOption<110 IsSync extends boolean = boolean,111 IsArray extends boolean = boolean,112> =113 | CommonStdioOption<IsSync, IsArray>114 | InputStdioOption<IsSync, IsArray>115 | OutputStdioOption<IsSync, IsArray>;116117export type StdioOption<IsSync extends boolean = boolean> =88 | StdioSingleOption<IsSync>89 | Array<StdioSingleOption<IsSync>>;118 | StdioSingleOption<IsSync, false>119 | Array<StdioSingleOption<IsSync, true>>;120121type StdioOptionsArray<IsSync extends boolean = boolean> = readonly [122 StdinOption<IsSync>,123 StdoutStderrOption<IsSync>,124 StdoutStderrOption<IsSync>,125 ...Array<StdioOption<IsSync>>,126];12798type StdioOptions<IsSync extends boolean = boolean> = BaseStdioOption | StdioOptionsArray<IsSync>;128type StdioOptions<IsSync extends boolean = boolean> = BaseStdioOption<IsSync> | StdioOptionsArray<IsSync>;129130type DefaultEncodingOption = 'utf8';131type TextEncodingOption =132 | DefaultEncodingOption
324 unmodified lines
457 This cannot be used if the `encoding` option is binary.458459 @default false460 */431 readonly lines?: IfAsync<IsSync, boolean>;461 readonly lines?: Unless<IsSync, boolean>;462463 /**464 Setting this to `false` resolves the promise with the error instead of rejecting it.465
124 unmodified lines
590 Also, this does not work on Windows, because Windows [doesn't support signals](https://nodejs.org/api/process.html#process_signal_events): `SIGKILL` and `SIGTERM` both terminate the subprocess immediately. Other packages (such as [`taskkill`](https://github.com/sindresorhus/taskkill)) can be used to achieve fail-safe termination on Windows.591592 @default 5000593 */564 forceKillAfterDelay?: number | false;594 forceKillAfterDelay?: Unless<IsSync, number | false>;595596 /**597 If `true`, no quoting or escaping of arguments is done on Windows. Ignored on other platforms. This is set to `true` automatically when the `shell` option is `true`.598
28 unmodified lines
627 - the current process is terminated abruptly, for example, with `SIGKILL` as opposed to `SIGTERM` or a normal exit628629 @default true630 */601 readonly cleanup?: IfAsync<IsSync, boolean>;631 readonly cleanup?: Unless<IsSync, boolean>;632633 /**634 Whether to return the subprocess' output using the `result.stdout`, `result.stderr`, `result.all` and `result.stdio` properties.635
2 unmodified lines
638 When `buffer` is `false`, the output can still be read using the `subprocess.stdout`, `subprocess.stderr`, `subprocess.stdio` and `subprocess.all` streams. If the output is read, this should be done right away to avoid missing any data.639640 @default true641 */612 readonly buffer?: IfAsync<IsSync, boolean>;642 readonly buffer?: Unless<IsSync, boolean>;643644 /**645 Add an `.all` property on the promise and the resolved value. The property contains the output of the subprocess with `stdout` and `stderr` interleaved.646647 @default false648 */619 readonly all?: IfAsync<IsSync, boolean>;649 readonly all?: Unless<IsSync, boolean>;650651 /**652 Enables exchanging messages with the subprocess using [`subprocess.send(value)`](https://nodejs.org/api/child_process.html#subprocesssendmessage-sendhandle-options-callback) and [`subprocess.on('message', (value) => {})`](https://nodejs.org/api/child_process.html#event-message).653654 @default `true` if the `node` option is enabled, `false` otherwise655 */626 readonly ipc?: IfAsync<IsSync, boolean>;656 readonly ipc?: Unless<IsSync, boolean>;657658 /**659 Specify the kind of serialization used for sending messages between subprocesses when using the `ipc` option:660 - `json`: Uses `JSON.stringify()` and `JSON.parse()`.
2 unmodified lines
663 [More info.](https://nodejs.org/api/child_process.html#child_process_advanced_serialization)664665 @default 'advanced'666 */637 readonly serialization?: IfAsync<IsSync, 'json' | 'advanced'>;667 readonly serialization?: Unless<IsSync, 'json' | 'advanced'>;668669 /**670 Prepare subprocess to run independently of the current process. Specific behavior [depends on the platform](https://nodejs.org/api/child_process.html#child_process_options_detached).671672 @default false673 */644 readonly detached?: IfAsync<IsSync, boolean>;674 readonly detached?: Unless<IsSync, boolean>;675676 /**677 You can abort the subprocess using [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController).678
17 unmodified lines
696 console.log(error.isCanceled); // true697 }698 ```699 */670 readonly cancelSignal?: IfAsync<IsSync, AbortSignal>;700 readonly cancelSignal?: Unless<IsSync, AbortSignal>;701};702703export type Options = CommonOptions<false>;704export type SyncOptions = CommonOptions<true>;
103 unmodified lines
808 - both `stdout` and `stderr` options are set to [`'inherit'`, `'ignore'`, `Stream` or `integer`](https://nodejs.org/api/child_process.html#child_process_options_stdio)809810 This is an array if the `lines` option is `true`, or if either the `stdout` or `stderr` option is a transform in object mode.811 */782 all: IfAsync<IsSync, AllOutput<OptionsType>>;812 all: Unless<IsSync, AllOutput<OptionsType>>;813814 /**815 Results of the other subprocesses that were piped into this subprocess. This is useful to inspect a series of subprocesses piped with each other.816817 This array is initially empty and is populated each time the `.pipe()` method resolves.818 */789 pipedFrom: IfAsync<IsSync, ExecaResult[], []>;819 pipedFrom: Unless<IsSync, ExecaResult[], []>;820821 /**822 Error message when the subprocess failed to run. In addition to the underlying error message, it also contains some information related to why the subprocess errored.823
809 unmodified lines
modified:index.test-d.ts+81 added-98 removed
548 unmodified lines
549 expectType<undefined>(ignoreStdoutResult.stdout);550 expectType<string>(ignoreStdoutResult.stderr);551 expectType<string>(ignoreStdoutResult.all);552553 const ignoreArrayStdoutResult = await execa('unicorns', {stdout: ['ignore'] as ['ignore'], all: true});554 expectType<undefined>(ignoreArrayStdoutResult.stdout);555 expectType<string>(ignoreArrayStdoutResult.stderr);556 expectType<string>(ignoreArrayStdoutResult.all);557553 const ignoreStderrPromise = execa('unicorns', {stderr: 'ignore', all: true});554 expectType<Writable>(ignoreStderrPromise.stdin);555 expectType<Readable>(ignoreStderrPromise.stdout);556 expectType<null>(ignoreStderrPromise.stderr);
2 unmodified lines
559 expectType<string>(ignoreStderrResult.stdout);560 expectType<undefined>(ignoreStderrResult.stderr);561 expectType<string>(ignoreStderrResult.all);562568 const ignoreArrayStderrResult = await execa('unicorns', {stderr: ['ignore'] as ['ignore'], all: true});569 expectType<string>(ignoreArrayStderrResult.stdout);570 expectType<undefined>(ignoreArrayStderrResult.stderr);571 expectType<string>(ignoreArrayStderrResult.all);572563 const inheritStdoutResult = await execa('unicorns', {stdout: 'inherit', all: true});564 expectType<undefined>(inheritStdoutResult.stdout);565 expectType<string>(inheritStdoutResult.stderr);566 expectType<string>(inheritStdoutResult.all);
17 unmodified lines
584 expectType<undefined>(ipcStdoutResult.stdout);585 expectType<string>(ipcStdoutResult.stderr);586 expectType<string>(ipcStdoutResult.all);587598 const ipcArrayStdoutResult = await execa('unicorns', {stdout: ['ipc'] as ['ipc'], all: true});599 expectType<undefined>(ipcArrayStdoutResult.stdout);600 expectType<string>(ipcArrayStdoutResult.stderr);601 expectType<string>(ipcArrayStdoutResult.all);602588 const ipcStderrResult = await execa('unicorns', {stderr: 'ipc', all: true});589 expectType<string>(ipcStderrResult.stdout);590 expectType<undefined>(ipcStderrResult.stderr);591 expectType<string>(ipcStderrResult.all);592608 const ipcArrayStderrResult = await execa('unicorns', {stderr: ['ipc'] as ['ipc'], all: true});609 expectType<string>(ipcArrayStderrResult.stdout);610 expectType<undefined>(ipcArrayStderrResult.stderr);611 expectType<string>(ipcArrayStderrResult.all);612593 const numberStdoutResult = await execa('unicorns', {stdout: 1, all: true});594 expectType<undefined>(numberStdoutResult.stdout);595 expectType<string>(numberStdoutResult.stderr);596 expectType<string>(numberStdoutResult.all);
438 unmodified lines
1035 expectType<string>(inheritStderrResult.stdout);1036 expectType<undefined>(inheritStderrResult.stderr);1037 expectError(inheritStderrResult.all.toString());10381059 const ipcStdoutResult = execaSync('unicorns', {stdout: 'ipc'});1060 expectType<undefined>(ipcStdoutResult.stdout);1061 expectType<string>(ipcStdoutResult.stderr);1062 expectError(ipcStdoutResult.all.toString());10631064 const ipcStderrResult = execaSync('unicorns', {stderr: 'ipc'});1065 expectType<string>(ipcStderrResult.stdout);1066 expectType<undefined>(ipcStderrResult.stderr);1067 expectError(ipcStderrResult.all.toString());10681039 const numberStdoutResult = execaSync('unicorns', {stdout: 1});1040 expectType<undefined>(numberStdoutResult.stdout);1041 expectType<string>(numberStdoutResult.stderr);1042 expectError(numberStdoutResult.all.toString());
59 unmodified lines
1102 expectType<string>(inheritStderrError.stdout);1103 expectType<undefined>(inheritStderrError.stderr);1104 expectError(inheritStderrError.all.toString());11051136 const ipcStdoutError = error as ExecaSyncError<{stdout: 'ipc'}>;1137 expectType<undefined>(ipcStdoutError.stdout);1138 expectType<string>(ipcStdoutError.stderr);1139 expectError(ipcStdoutError.all.toString());11401141 const ipcStderrError = error as ExecaSyncError<{stderr: 'ipc'}>;1142 expectType<string>(ipcStderrError.stdout);1143 expectType<undefined>(ipcStderrError.stderr);1144 expectError(ipcStderrError.all.toString());11451106 const numberStdoutError = error as ExecaSyncError<{stdout: 1}>;1107 expectType<undefined>(numberStdoutError.stdout);1108 expectType<string>(numberStdoutError.stderr);1109 expectError(numberStdoutError.all.toString());
94 unmodified lines
1204execa('unicorns', {stdin: 'pipe'});1205execaSync('unicorns', {stdin: 'pipe'});1206execa('unicorns', {stdin: ['pipe']});1207execaSync('unicorns', {stdin: ['pipe']});1208execa('unicorns', {stdin: undefined});1209execaSync('unicorns', {stdin: undefined});1210execa('unicorns', {stdin: [undefined]});1211execaSync('unicorns', {stdin: [undefined]});1212execa('unicorns', {stdin: 'overlapped'});1249execaSync('unicorns', {stdin: 'overlapped'});1213expectError(execaSync('unicorns', {stdin: 'overlapped'}));1214execa('unicorns', {stdin: ['overlapped']});1251execaSync('unicorns', {stdin: ['overlapped']});1215expectError(execaSync('unicorns', {stdin: ['overlapped']}));1216execa('unicorns', {stdin: 'ipc'});1253execaSync('unicorns', {stdin: 'ipc'});1217expectError(execaSync('unicorns', {stdin: 'ipc'}));1218execa('unicorns', {stdin: ['ipc']});1255execaSync('unicorns', {stdin: ['ipc']});1219expectError(execaSync('unicorns', {stdin: ['ipc']}));1220execa('unicorns', {stdin: 'ignore'});1221execaSync('unicorns', {stdin: 'ignore'});1222execa('unicorns', {stdin: ['ignore']});1259execaSync('unicorns', {stdin: ['ignore']});1223expectError(execaSync('unicorns', {stdin: ['ignore']}));1224execa('unicorns', {stdin: 'inherit'});1225execaSync('unicorns', {stdin: 'inherit'});1226execa('unicorns', {stdin: ['inherit']});1263execaSync('unicorns', {stdin: ['inherit']});1227expectError(execaSync('unicorns', {stdin: ['inherit']}));1228execa('unicorns', {stdin: process.stdin});1229execaSync('unicorns', {stdin: process.stdin});1230execa('unicorns', {stdin: [process.stdin]});1267execaSync('unicorns', {stdin: [process.stdin]});1231expectError(execaSync('unicorns', {stdin: [process.stdin]}));1232execa('unicorns', {stdin: new Readable()});1233execaSync('unicorns', {stdin: new Readable()});1234execa('unicorns', {stdin: [new Readable()]});1271execaSync('unicorns', {stdin: [new Readable()]});1235expectError(execaSync('unicorns', {stdin: [new Readable()]}));1236expectError(execa('unicorns', {stdin: new Writable()}));1237expectError(execaSync('unicorns', {stdin: new Writable()}));1238expectError(execaSync('unicorns', {stdin: [new Writable()]}));1239execa('unicorns', {stdin: new ReadableStream()});
4 unmodified lines
1244expectError(execaSync('unicorns', {stdin: new WritableStream()}));1245expectError(execaSync('unicorns', {stdin: [new WritableStream()]}));1246execa('unicorns', {stdin: new Uint8Array()});1247execaSync('unicorns', {stdin: new Uint8Array()});1248execa('unicorns', {stdin: [new Uint8Array()]});1249execaSync('unicorns', {stdin: [new Uint8Array()]});1250execa('unicorns', {stdin: [['foo', 'bar']]});1251expectError(execaSync('unicorns', {stdin: [['foo', 'bar']]}));1252execa('unicorns', {stdin: [[new Uint8Array(), new Uint8Array()]]});1253expectError(execaSync('unicorns', {stdin: [[new Uint8Array(), new Uint8Array()]]}));
23 unmodified lines
1277execaSync('unicorns', {stdin: [{file: './test'}]});1278execa('unicorns', {stdin: 1});1279execaSync('unicorns', {stdin: 1});1280execa('unicorns', {stdin: [1]});1315execaSync('unicorns', {stdin: [1]});1281expectError(execaSync('unicorns', {stdin: [1]}));1282execa('unicorns', {stdin: duplex});1283expectError(execaSync('unicorns', {stdin: duplex}));1284execa('unicorns', {stdin: [duplex]});1285expectError(execaSync('unicorns', {stdin: [duplex]}));
60 unmodified lines
1346execaSync('unicorns', {stdin: undefined});1347execa('unicorns', {stdin: [undefined]});1348execaSync('unicorns', {stdin: [undefined]});1349execa('unicorns', {stdin: ['pipe', 'inherit']});1350expectError(execaSync('unicorns', {stdin: ['pipe', 'inherit']}));1351execa('unicorns', {stdin: ['pipe', undefined]});1384execaSync('unicorns', {stdin: ['pipe', 'inherit']});1352execaSync('unicorns', {stdin: ['pipe', undefined]});1353execa('unicorns', {stdout: 'pipe'});1354execaSync('unicorns', {stdout: 'pipe'});1355execa('unicorns', {stdout: ['pipe']});1356execaSync('unicorns', {stdout: ['pipe']});1357execa('unicorns', {stdout: undefined});1358execaSync('unicorns', {stdout: undefined});1359execa('unicorns', {stdout: [undefined]});1360execaSync('unicorns', {stdout: [undefined]});1361execa('unicorns', {stdout: 'overlapped'});1390execaSync('unicorns', {stdout: 'overlapped'});1362expectError(execaSync('unicorns', {stdout: 'overlapped'}));1363execa('unicorns', {stdout: ['overlapped']});1392execaSync('unicorns', {stdout: ['overlapped']});1364expectError(execaSync('unicorns', {stdout: ['overlapped']}));1365execa('unicorns', {stdout: 'ipc'});1394execaSync('unicorns', {stdout: 'ipc'});1395execa('unicorns', {stdout: ['ipc']});1396execaSync('unicorns', {stdout: ['ipc']});1366expectError(execaSync('unicorns', {stdout: 'ipc'}));1367expectError(execa('unicorns', {stdout: ['ipc']}));1368expectError(execaSync('unicorns', {stdout: ['ipc']}));1369execa('unicorns', {stdout: 'ignore'});1370execaSync('unicorns', {stdout: 'ignore'});1399execa('unicorns', {stdout: ['ignore']});1400execaSync('unicorns', {stdout: ['ignore']});1371expectError(execa('unicorns', {stdout: ['ignore']}));1372expectError(execaSync('unicorns', {stdout: ['ignore']}));1373execa('unicorns', {stdout: 'inherit'});1374execaSync('unicorns', {stdout: 'inherit'});1375execa('unicorns', {stdout: ['inherit']});1404execaSync('unicorns', {stdout: ['inherit']});1376expectError(execaSync('unicorns', {stdout: ['inherit']}));1377execa('unicorns', {stdout: process.stdout});1378execaSync('unicorns', {stdout: process.stdout});1379execa('unicorns', {stdout: [process.stdout]});1408execaSync('unicorns', {stdout: [process.stdout]});1380expectError(execaSync('unicorns', {stdout: [process.stdout]}));1381execa('unicorns', {stdout: new Writable()});1382execaSync('unicorns', {stdout: new Writable()});1383execa('unicorns', {stdout: [new Writable()]});1412execaSync('unicorns', {stdout: [new Writable()]});1384expectError(execaSync('unicorns', {stdout: [new Writable()]}));1385expectError(execa('unicorns', {stdout: new Readable()}));1386expectError(execaSync('unicorns', {stdout: new Readable()}));1387expectError(execa('unicorn', {stdout: [new Readable()]}));1388expectError(execaSync('unicorn', {stdout: [new Readable()]}));
17 unmodified lines
1406expectError(execaSync('unicorns', {stdout: {file: fileUrl}}));1407execa('unicorns', {stdout: 1});1408execaSync('unicorns', {stdout: 1});1409execa('unicorns', {stdout: [1]});1438execaSync('unicorns', {stdout: [1]});1410expectError(execaSync('unicorns', {stdout: [1]}));1411execa('unicorns', {stdout: duplex});1412expectError(execaSync('unicorns', {stdout: duplex}));1413execa('unicorns', {stdout: [duplex]});1414expectError(execaSync('unicorns', {stdout: [duplex]}));
60 unmodified lines
1475execaSync('unicorns', {stdout: undefined});1476execa('unicorns', {stdout: [undefined]});1477execaSync('unicorns', {stdout: [undefined]});1478execa('unicorns', {stdout: ['pipe', 'inherit']});1479expectError(execaSync('unicorns', {stdout: ['pipe', 'inherit']}));1480execa('unicorns', {stdout: ['pipe', undefined]});1507execaSync('unicorns', {stdout: ['pipe', 'inherit']});1481execaSync('unicorns', {stdout: ['pipe', undefined]});1482execa('unicorns', {stderr: 'pipe'});1483execaSync('unicorns', {stderr: 'pipe'});1484execa('unicorns', {stderr: ['pipe']});1485execaSync('unicorns', {stderr: ['pipe']});1486execa('unicorns', {stderr: undefined});1487execaSync('unicorns', {stderr: undefined});1488execa('unicorns', {stderr: [undefined]});1489execaSync('unicorns', {stderr: [undefined]});1490execa('unicorns', {stderr: 'overlapped'});1513execaSync('unicorns', {stderr: 'overlapped'});1491expectError(execaSync('unicorns', {stderr: 'overlapped'}));1492execa('unicorns', {stderr: ['overlapped']});1515execaSync('unicorns', {stderr: ['overlapped']});1493expectError(execaSync('unicorns', {stderr: ['overlapped']}));1494execa('unicorns', {stderr: 'ipc'});1517execaSync('unicorns', {stderr: 'ipc'});1518execa('unicorns', {stderr: ['ipc']});1519execaSync('unicorns', {stderr: ['ipc']});1495expectError(execaSync('unicorns', {stderr: 'ipc'}));1496expectError(execa('unicorns', {stderr: ['ipc']}));1497expectError(execaSync('unicorns', {stderr: ['ipc']}));1498execa('unicorns', {stderr: 'ignore'});1499execaSync('unicorns', {stderr: 'ignore'});1522execa('unicorns', {stderr: ['ignore']});1523execaSync('unicorns', {stderr: ['ignore']});1500expectError(execa('unicorns', {stderr: ['ignore']}));1501expectError(execaSync('unicorns', {stderr: ['ignore']}));1502execa('unicorns', {stderr: 'inherit'});1503execaSync('unicorns', {stderr: 'inherit'});1504execa('unicorns', {stderr: ['inherit']});1527execaSync('unicorns', {stderr: ['inherit']});1505expectError(execaSync('unicorns', {stderr: ['inherit']}));1506execa('unicorns', {stderr: process.stderr});1507execaSync('unicorns', {stderr: process.stderr});1508execa('unicorns', {stderr: [process.stderr]});1531execaSync('unicorns', {stderr: [process.stderr]});1509expectError(execaSync('unicorns', {stderr: [process.stderr]}));1510execa('unicorns', {stderr: new Writable()});1511execaSync('unicorns', {stderr: new Writable()});1512execa('unicorns', {stderr: [new Writable()]});1535execaSync('unicorns', {stderr: [new Writable()]});1513expectError(execaSync('unicorns', {stderr: [new Writable()]}));1514expectError(execa('unicorns', {stderr: new Readable()}));1515expectError(execaSync('unicorns', {stderr: new Readable()}));1516expectError(execa('unicorns', {stderr: [new Readable()]}));1517expectError(execaSync('unicorns', {stderr: [new Readable()]}));
17 unmodified lines
1535expectError(execaSync('unicorns', {stderr: {file: fileUrl}}));1536execa('unicorns', {stderr: 1});1537execaSync('unicorns', {stderr: 1});1538execa('unicorns', {stderr: [1]});1561execaSync('unicorns', {stderr: [1]});1539expectError(execaSync('unicorns', {stderr: [1]}));1540execa('unicorns', {stderr: duplex});1541expectError(execaSync('unicorns', {stderr: duplex}));1542execa('unicorns', {stderr: [duplex]});1543expectError(execaSync('unicorns', {stderr: [duplex]}));
60 unmodified lines
1604execaSync('unicorns', {stderr: undefined});1605execa('unicorns', {stderr: [undefined]});1606execaSync('unicorns', {stderr: [undefined]});1607execa('unicorns', {stderr: ['pipe', 'inherit']});1608expectError(execaSync('unicorns', {stderr: ['pipe', 'inherit']}));1609execa('unicorns', {stderr: ['pipe', undefined]});1630execaSync('unicorns', {stderr: ['pipe', 'inherit']});1610execaSync('unicorns', {stderr: ['pipe', undefined]});1611execa('unicorns', {all: true});1612expectError(execaSync('unicorns', {all: true}));1613execa('unicorns', {reject: false});1614execaSync('unicorns', {reject: false});
12 unmodified lines
1627execa('unicorns', {argv0: ''});1628execaSync('unicorns', {argv0: ''});1629execa('unicorns', {stdio: 'pipe'});1630execaSync('unicorns', {stdio: 'pipe'});1631execa('unicorns', {stdio: undefined});1632execaSync('unicorns', {stdio: undefined});1633execa('unicorns', {stdio: 'overlapped'});1652execaSync('unicorns', {stdio: 'overlapped'});1634expectError(execaSync('unicorns', {stdio: 'overlapped'}));1635execa('unicorns', {stdio: 'ignore'});1636execaSync('unicorns', {stdio: 'ignore'});1637execa('unicorns', {stdio: 'inherit'});1638execaSync('unicorns', {stdio: 'inherit'});
33 unmodified lines
1672expectError(execaSync('unicorns', {stdio: ['pipe', 'pipe']}));1673execa('unicorns', {stdio: [new Readable(), 'pipe', 'pipe']});1674execaSync('unicorns', {stdio: [new Readable(), 'pipe', 'pipe']});1675execa('unicorns', {stdio: [[new Readable()], ['pipe'], ['pipe']]});1694execaSync('unicorns', {stdio: [[new Readable()], ['pipe'], ['pipe']]});1676expectError(execaSync('unicorns', {stdio: [[new Readable()], ['pipe'], ['pipe']]}));1677execa('unicorns', {stdio: ['pipe', new Writable(), 'pipe']});1678execaSync('unicorns', {stdio: ['pipe', new Writable(), 'pipe']});1679execa('unicorns', {stdio: [['pipe'], [new Writable()], ['pipe']]});1698execaSync('unicorns', {stdio: [['pipe'], [new Writable()], ['pipe']]});1680expectError(execaSync('unicorns', {stdio: [['pipe'], [new Writable()], ['pipe']]}));1681execa('unicorns', {stdio: ['pipe', 'pipe', new Writable()]});1682execaSync('unicorns', {stdio: ['pipe', 'pipe', new Writable()]});1683execa('unicorns', {stdio: [['pipe'], ['pipe'], [new Writable()]]});1702execaSync('unicorns', {stdio: [['pipe'], ['pipe'], [new Writable()]]});1684expectError(execaSync('unicorns', {stdio: [['pipe'], ['pipe'], [new Writable()]]}));1685expectError(execa('unicorns', {stdio: [new Writable(), 'pipe', 'pipe']}));1686expectError(execaSync('unicorns', {stdio: [new Writable(), 'pipe', 'pipe']}));1687expectError(execaSync('unicorns', {stdio: [[new Writable()], ['pipe'], ['pipe']]}));1688expectError(execa('unicorns', {stdio: ['pipe', new Readable(), 'pipe']}));
6 unmodified lines
1695expectError(execaSync('unicorns', {stdio: [['pipe'], ['pipe'], [new Readable()]]}));1696execa('unicorns', {1697 stdio: [1698 'pipe',1699 undefined,1700 'overlapped',1701 'ipc',1702 'ignore',1703 'inherit',
4 unmodified lines
1708 {transform: unknownGenerator, binary: true},1709 {transform: unknownGenerator, preserveNewlines: true},1710 {transform: unknownGenerator, objectMode: true},1711 {transform: unknownGenerator, final: unknownFinal},1729 undefined,1712 fileUrl,1713 {file: './test'},1714 duplex,1715 duplexTransform,
10 unmodified lines
1726});1727execaSync('unicorns', {1728 stdio: [1729 'pipe',1748 'overlapped',1749 'ipc',1730 undefined,1731 'ignore',1732 'inherit',1733 process.stdin,1734 1,1754 undefined,1735 fileUrl,1736 {file: './test'},1737 new Writable(),1738 new Readable(),1739 new Uint8Array(),1740 ],1741});1742expectError(execaSync('unicorns', {stdio: ['overlapped']}));1743expectError(execaSync('unicorns', {stdio: ['ipc']}));1744expectError(execaSync('unicorns', {stdio: [unknownGenerator]}));1745expectError(execaSync('unicorns', {stdio: [{transform: unknownGenerator}]}));1746expectError(execaSync('unicorns', {stdio: [duplex]}));1747expectError(execaSync('unicorns', {stdio: [duplexTransform]}));
6 unmodified lines
1754execa('unicorns', {1755 stdio: [1756 ['pipe'],1757 ['pipe', 'inherit'],1758 ['pipe', undefined],1759 [undefined],1760 ['overlapped'],1761 ['ipc'],1762 ['ignore'],1763 ['inherit'],
4 unmodified lines
1768 [{transform: unknownGenerator, binary: true}],1769 [{transform: unknownGenerator, preserveNewlines: true}],1770 [{transform: unknownGenerator, objectMode: true}],1771 [{transform: unknownGenerator, final: unknownFinal}],1788 [undefined],1772 [fileUrl],1773 [{file: './test'}],1774 [duplex],1775 [duplexTransform],
13 unmodified lines
1789});1790execaSync('unicorns', {1791 stdio: [1792 ['pipe'],1810 ['pipe', 'inherit'],1811 ['overlapped'],1812 ['ipc'],1813 ['ignore'],1814 ['inherit'],1815 [process.stdin],1816 [1],1793 ['pipe', undefined],1794 [undefined],1818 [fileUrl],1819 [{file: './test'}],1820 [new Writable()],1821 [new Readable()],1822 [new Uint8Array()],1795 ],1796});1797expectError(execaSync('unicorns', {stdio: [['pipe', 'inherit']]}));1798expectError(execaSync('unicorns', {stdio: [['overlapped']]}));1799expectError(execaSync('unicorns', {stdio: [['ipc']]}));1800expectError(execaSync('unicorns', {stdio: [['ignore']]}));1801expectError(execaSync('unicorns', {stdio: [['inherit']]}));1802expectError(execaSync('unicorns', {stdio: [[process.stdin]]}));1803expectError(execaSync('unicorns', {stdio: [[1]]}));1804expectError(execaSync('unicorns', {stdio: [[fileUrl]]}));1805expectError(execaSync('unicorns', {stdio: [[{file: './test'}]]}));1806expectError(execaSync('unicorns', {stdio: [[new Writable()]]}));1807expectError(execaSync('unicorns', {stdio: [[new Readable()]]}));1808expectError(execaSync('unicorns', {stdio: [[new Uint8Array()]]}));1809expectError(execaSync('unicorns', {stdio: [[unknownGenerator]]}));1810expectError(execaSync('unicorns', {stdio: [[{transform: unknownGenerator}]]}));1811expectError(execaSync('unicorns', {stdio: [[duplex]]}));1812expectError(execaSync('unicorns', {stdio: [[duplexTransform]]}));
38 unmodified lines
1851execaSync('unicorns', {killSignal: 'SIGTERM'});1852execa('unicorns', {killSignal: 9});1853execaSync('unicorns', {killSignal: 9});1854execa('unicorns', {forceKillAfterDelay: false});1871execaSync('unicorns', {forceKillAfterDelay: false});1855expectError(execaSync('unicorns', {forceKillAfterDelay: false}));1856execa('unicorns', {forceKillAfterDelay: 42});1873execaSync('unicorns', {forceKillAfterDelay: 42});1857expectError(execaSync('unicorns', {forceKillAfterDelay: 42}));1858execa('unicorns', {forceKillAfterDelay: undefined});1875execaSync('unicorns', {forceKillAfterDelay: undefined});1859expectError(execa('unicorns', {forceKillAfterDelay: 'true'}));1860expectError(execaSync('unicorns', {forceKillAfterDelay: 'true'}));1861execa('unicorns', {cancelSignal: new AbortController().signal});1862expectError(execaSync('unicorns', {cancelSignal: new AbortController().signal}));
393 unmodified lines