Skip to content
Myr

result-ipc.ts

This file

Path

test-d/return/result-ipc.ts

110 lines · 4.6 KiB · TypeScript

Last changed by

Fix `execaNode()` and the `node` option missing IPC in their typesSindre Sorhusbefore adoption2633abb

History of this file

Take it

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

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

Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de

lines 2–4why, one step back
2import {
3 execa,4 execaSync,

Fix `execaNode()` and the `node` option missing IPC in their typesSindre Sorhusbefore adoption2633abb

line 5why, one step back
5 execaNode,

Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de

lines 6–9why, one step back
6 type Result,
7 type SyncResult,8 type ExecaError,9 type ExecaSyncError,

Fix type of `result.ipc` (#1071)ehmickybefore adoption69152ec

line 10why, one step back
10 type Message,

Add `ipcInput` option (#1068)ehmickybefore adoption46cae30

line 11why, one step back
11 type Options,

Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de

lines 12–14why, one step back
12} from '../../index.js';
1314const ipcResult = await execa('unicorns', {ipc: true});

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

line 15why, one step back
15expectTypeOf(ipcResult.ipcOutput).toBe<Array<Message<'advanced'>>>();

Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de

lines 16–17why, one step back
16
17const ipcFdResult = await execa('unicorns', {ipc: true, buffer: {stdout: false}});

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

line 18why, one step back
18expectTypeOf(ipcFdResult.ipcOutput).toBe<Array<Message<'advanced'>>>();

Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de

line 19why, one step back
19

Fix type of `result.ipc` (#1071)ehmickybefore adoption69152ec

line 20why, one step back
20const advancedResult = await execa('unicorns', {ipc: true, serialization: 'advanced'});

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

line 21why, one step back
21expectTypeOf(advancedResult.ipcOutput).toBe<Array<Message<'advanced'>>>();

Fix type of `result.ipc` (#1071)ehmickybefore adoption69152ec

lines 22–23why, one step back
22
23const jsonResult = await execa('unicorns', {ipc: true, serialization: 'json'});

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

line 24why, one step back
24expectTypeOf(jsonResult.ipcOutput).toBe<Array<Message<'json'>>>();

Fix type of `result.ipc` (#1071)ehmickybefore adoption69152ec

line 25why, one step back
25

Add `ipcInput` option (#1068)ehmickybefore adoption46cae30

line 26why, one step back
26const inputResult = await execa('unicorns', {ipcInput: ''});

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

line 27why, one step back
27expectTypeOf(inputResult.ipcOutput).toBe<Array<Message<'advanced'>>>();

Add `ipcInput` option (#1068)ehmickybefore adoption46cae30

lines 28–29why, one step back
28
29const genericInputResult = await execa('unicorns', {ipcInput: '' as Message});

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

line 30why, one step back
30expectTypeOf(genericInputResult.ipcOutput).toBe<Array<Message<'advanced'>>>();

Add `ipcInput` option (#1068)ehmickybefore adoption46cae30

line 31why, one step back
31

Add `gracefulCancel` option (#1109)ehmickybefore adoptiond8190e5

line 32why, one step back
32const gracefulResult = await execa('unicorns', {gracefulCancel: true, cancelSignal: AbortSignal.abort()});

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

line 33why, one step back
33expectTypeOf(gracefulResult.ipcOutput).toBe<Array<Message<'advanced'>>>();

Add `gracefulCancel` option (#1109)ehmickybefore adoptiond8190e5

line 34why, one step back
34

Fix `execaNode()` and the `node` option missing IPC in their typesSindre Sorhusbefore adoption2633abb

lines 35–43why, one step back
35const nodeResult = await execa('unicorns', {node: true});
36expectTypeOf(nodeResult.ipcOutput).toBe<Array<Message<'advanced'>>>();3738const execaNodeResult = await execaNode('unicorns');39expectTypeOf(execaNodeResult.ipcOutput).toBe<Array<Message<'advanced'>>>();4041const execaNodeJsonResult = await execaNode({serialization: 'json'})`unicorns`;42expectTypeOf(execaNodeJsonResult.ipcOutput).toBe<Array<Message<'json'>>>();43

Add `ipcInput` option (#1068)ehmickybefore adoption46cae30

line 44why, one step back
44const genericResult = await execa('unicorns', {} as Options);

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

line 45why, one step back
45expectTypeOf(genericResult.ipcOutput).toBe<Message[] | []>();

Add `ipcInput` option (#1068)ehmickybefore adoption46cae30

lines 46–47why, one step back
46
47const genericIpc = await execa('unicorns', {ipc: true as boolean});

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

line 48why, one step back
48expectTypeOf(genericIpc.ipcOutput).toBe<Array<Message<'advanced'>> | []>();

Add `ipcInput` option (#1068)ehmickybefore adoption46cae30

lines 49–50why, one step back
49
50const maybeInputResult = await execa('unicorns', {ipcInput: '' as '' | undefined});

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

line 51why, one step back
51expectTypeOf(maybeInputResult.ipcOutput).toBe<Array<Message<'advanced'>> | []>();

Add `ipcInput` option (#1068)ehmickybefore adoption46cae30

line 52why, one step back
52

Add `gracefulCancel` option (#1109)ehmickybefore adoptiond8190e5

line 53why, one step back
53const maybeGracefulResult = await execa('unicorns', {gracefulCancel: true as boolean | undefined, cancelSignal: AbortSignal.abort()});

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

line 54why, one step back
54expectTypeOf(maybeGracefulResult.ipcOutput).toBe<Array<Message<'advanced'>> | []>();

Add `gracefulCancel` option (#1109)ehmickybefore adoptiond8190e5

line 55why, one step back
55

Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de

line 56why, one step back
56const falseIpcResult = await execa('unicorns', {ipc: false});

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

line 57why, one step back
57expectTypeOf(falseIpcResult.ipcOutput).toBe<[]>();

Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de

lines 58–59why, one step back
58
59const noIpcResult = await execa('unicorns');

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

line 60why, one step back
60expectTypeOf(noIpcResult.ipcOutput).toBe<[]>();

Add `ipcInput` option (#1068)ehmickybefore adoption46cae30

lines 61–62why, one step back
61
62const emptyIpcResult = await execa('unicorns', {});

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

line 63why, one step back
63expectTypeOf(emptyIpcResult.ipcOutput).toBe<[]>();

Add `ipcInput` option (#1068)ehmickybefore adoption46cae30

lines 64–65why, one step back
64
65const undefinedInputResult = await execa('unicorns', {ipcInput: undefined});

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

line 66why, one step back
66expectTypeOf(undefinedInputResult.ipcOutput).toBe<[]>();

Add `ipcInput` option (#1068)ehmickybefore adoption46cae30

lines 67–68why, one step back
67
68const inputNoIpcResult = await execa('unicorns', {ipc: false, ipcInput: ''});

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

line 69why, one step back
69expectTypeOf(inputNoIpcResult.ipcOutput).toBe<[]>();

Add `gracefulCancel` option (#1109)ehmickybefore adoptiond8190e5

lines 70–71why, one step back
70
71const undefinedGracefulResult = await execa('unicorns', {gracefulCancel: undefined});

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

line 72why, one step back
72expectTypeOf(undefinedGracefulResult.ipcOutput).toBe<[]>();

Add `gracefulCancel` option (#1109)ehmickybefore adoptiond8190e5

lines 73–74why, one step back
73
74const falseGracefulResult = await execa('unicorns', {gracefulCancel: false});

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

line 75why, one step back
75expectTypeOf(falseGracefulResult.ipcOutput).toBe<[]>();

Add `gracefulCancel` option (#1109)ehmickybefore adoptiond8190e5

lines 76–77why, one step back
76
77const gracefulNoIpcResult = await execa('unicorns', {ipc: false, gracefulCancel: true, cancelSignal: AbortSignal.abort()});

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

line 78why, one step back
78expectTypeOf(gracefulNoIpcResult.ipcOutput).toBe<[]>();

Fix `execaNode()` and the `node` option missing IPC in their typesSindre Sorhusbefore adoption2633abb

lines 79–84why, one step back
79
80const falseNodeResult = await execa('unicorns', {node: false});81expectTypeOf(falseNodeResult.ipcOutput).toBe<[]>();8283const execaNodeNoIpcResult = await execaNode('unicorns', {ipc: false});84expectTypeOf(execaNodeNoIpcResult.ipcOutput).toBe<[]>();

Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de

lines 85–86why, one step back
85
86const noBufferResult = await execa('unicorns', {ipc: true, buffer: false});

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

line 87why, one step back
87expectTypeOf(noBufferResult.ipcOutput).toBe<[]>();

Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de

lines 88–89why, one step back
88
89const noBufferFdResult = await execa('unicorns', {ipc: true, buffer: {ipc: false}});

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

line 90why, one step back
90expectTypeOf(noBufferFdResult.ipcOutput).toBe<[]>();

Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de

lines 91–92why, one step back
91
92const syncResult = execaSync('unicorns');

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

line 93why, one step back
93expectTypeOf(syncResult.ipcOutput).toBe<[]>();

Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de

line 94why, one step back
94

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

lines 95–97why, one step back
95expectTypeOf<Result['ipcOutput']>().toBe<Message[] | []>();
96expectTypeOf<Result['ipcOutput']>().toBeAssignableTo<Message[]>();97expectTypeOf({} as unknown as SyncResult['ipcOutput']).toBe<[]>();

Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de

lines 98–99why, one step back
98
99const ipcError = new Error('.') as ExecaError<{ipc: true}>;

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

line 100why, one step back
100expectTypeOf(ipcError.ipcOutput).toBe<Array<Message<'advanced'>>>();

Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de

lines 101–102why, one step back
101
102const ipcFalseError = new Error('.') as ExecaError<{ipc: false}>;

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

line 103why, one step back
103expectTypeOf(ipcFalseError.ipcOutput).toBe<[]>();

Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de

lines 104–105why, one step back
104
105const asyncError = new Error('.') as ExecaError;

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

lines 106–107why, one step back
106expectTypeOf(asyncError.ipcOutput).toBe<Message[] | []>();
107expectTypeOf(asyncError.ipcOutput).toBeAssignableTo<Message[]>();

Add `result.ipc`/`error.ipc` (#1067)ehmickybefore adoption3ab34de

lines 108–109why, one step back
108
109const syncError = new Error('.') as ExecaSyncError;

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

line 110why, one step back
110expectTypeOf(syncError.ipcOutput).toBe<[]>();