mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Make ChildProcessWithoutNullStreams a ChildProcess
This commit is contained in:
parent
372efcb075
commit
0237165eb1
2
types/node/child_process.d.ts
vendored
2
types/node/child_process.d.ts
vendored
@ -79,7 +79,7 @@ declare module "child_process" {
|
||||
}
|
||||
|
||||
// return this object when stdio option is undefined or not specified
|
||||
interface ChildProcessWithoutNullStreams {
|
||||
interface ChildProcessWithoutNullStreams extends ChildProcess {
|
||||
stdin: Writable;
|
||||
stdout: Readable;
|
||||
stderr: Readable;
|
||||
|
||||
@ -302,6 +302,25 @@ async function testPromisify() {
|
||||
expectNonNull(childProcess.spawn('command', ['a', 'b', 'c'], { stdio: [undefined, undefined, undefined] }));
|
||||
expectNonNull(childProcess.spawn('command', ['a', 'b', 'c'], { stdio: [null, null, null] }));
|
||||
expectNonNull(childProcess.spawn('command', ['a', 'b', 'c'], { stdio: ['pipe', 'pipe', 'pipe'] }));
|
||||
|
||||
function expectChildProcess (cp: childProcess.ChildProcess): void {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
expectChildProcess(childProcess.spawn('command'));
|
||||
expectChildProcess(childProcess.spawn('command', {}));
|
||||
expectChildProcess(childProcess.spawn('command', { stdio: undefined }));
|
||||
expectChildProcess(childProcess.spawn('command', { stdio: 'pipe' }));
|
||||
expectChildProcess(childProcess.spawn('command', { stdio: [undefined, undefined, undefined] }));
|
||||
expectChildProcess(childProcess.spawn('command', { stdio: [null, null, null] }));
|
||||
expectChildProcess(childProcess.spawn('command', { stdio: ['pipe', 'pipe', 'pipe'] }));
|
||||
expectChildProcess(childProcess.spawn('command', ['a', 'b', 'c']));
|
||||
expectChildProcess(childProcess.spawn('command', ['a', 'b', 'c'], {}));
|
||||
expectChildProcess(childProcess.spawn('command', ['a', 'b', 'c'], { stdio: undefined }));
|
||||
expectChildProcess(childProcess.spawn('command', ['a', 'b', 'c'], { stdio: 'pipe' }));
|
||||
expectChildProcess(childProcess.spawn('command', ['a', 'b', 'c'], { stdio: [undefined, undefined, undefined] }));
|
||||
expectChildProcess(childProcess.spawn('command', ['a', 'b', 'c'], { stdio: [null, null, null] }));
|
||||
expectChildProcess(childProcess.spawn('command', ['a', 'b', 'c'], { stdio: ['pipe', 'pipe', 'pipe'] }));
|
||||
}
|
||||
{
|
||||
process.stdin.setEncoding('utf8');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user