subprocess.test-d.ts
This file
Path
test-d/subprocess/subprocess.test-d.ts
40 lines · 1.6 KiB · TypeScript
Last changed by
Improve validation and typing of signals (#1025)ehmickybefore adoption7213287
History of this fileTake it
Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
line 1why, one step back1import {expectType, expectError, expectAssignable} from 'tsd';Rename some types (#1009)ehmickybefore adoption2ef9186
line 2why, one step back2import {execa, type Subprocess} from '../../index.js';Split type files (#978)ehmickybefore adoption0bd0f0d
line 3why, one step back3Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
line 4why, one step back4const subprocess = execa('unicorns');Rename some types (#1009)ehmickybefore adoption2ef9186
line 5why, one step back5expectAssignable<Subprocess>(subprocess);Split type files (#978)ehmickybefore adoption0bd0f0d
line 6why, one step back6Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
line 7why, one step back7expectType<number | undefined>(subprocess.pid);Split type files (#978)ehmickybefore adoption0bd0f0d
line 8why, one step back8Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
lines 9–16why, one step back9expectType<boolean>(subprocess.kill());10subprocess.kill('SIGKILL');11subprocess.kill(undefined);12subprocess.kill(new Error('test'));13subprocess.kill('SIGKILL', new Error('test'));14subprocess.kill(undefined, new Error('test'));15expectError(subprocess.kill(null));16expectError(subprocess.kill(0n));Improve validation and typing of signals (#1025)ehmickybefore adoption7213287
lines 17–22why, one step back17expectError(subprocess.kill('Sigkill'));18expectError(subprocess.kill('sigkill'));19expectError(subprocess.kill('SIGOTHER'));20expectError(subprocess.kill('SIGEMT'));21expectError(subprocess.kill('SIGCLD'));22expectError(subprocess.kill('SIGRT1'));Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
lines 23–27why, one step back23expectError(subprocess.kill([new Error('test')]));24expectError(subprocess.kill({message: 'test'}));25expectError(subprocess.kill(undefined, {}));26expectError(subprocess.kill('SIGKILL', {}));27expectError(subprocess.kill(null, new Error('test')));Split type files (#978)ehmickybefore adoption0bd0f0d
line 28why, one step back28Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
line 29why, one step back29const ipcSubprocess = execa('unicorns', {ipc: true});Rename some types (#1009)ehmickybefore adoption2ef9186
line 30why, one step back30expectAssignable<Subprocess>(subprocess);Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
lines 31–32why, one step back3132expectType<boolean>(ipcSubprocess.send({}));Split type files (#978)ehmickybefore adoption0bd0f0d
lines 33–34why, one step back33execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ipc']}).send({});34execa('unicorns', {stdio: ['pipe', 'pipe', 'ipc', 'pipe']}).send({});Fix the type of the return value (#1007)ehmickybefore adoption0a13f2b
lines 35–37why, one step back35ipcSubprocess.send('message');36ipcSubprocess.send({}, undefined, {keepOpen: true});37expectError(ipcSubprocess.send({}, true));Split type files (#978)ehmickybefore adoption0bd0f0d
lines 38–40why, one step back38expectType<undefined>(execa('unicorns', {}).send);39expectType<undefined>(execa('unicorns', {ipc: false}).send);40expectType<undefined>(execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'pipe']}).send);