From 372efcb075077edad0d5d1554d1e4bf439dae6fe Mon Sep 17 00:00:00 2001 From: khai96_ Date: Fri, 29 Mar 2019 15:20:27 +0700 Subject: [PATCH] Allow null to be in options.stdio array ref: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/34285#discussion_r270306571 --- types/node/child_process.d.ts | 2 +- types/node/test/child_process.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/types/node/child_process.d.ts b/types/node/child_process.d.ts index 50fb29ab12..6531e30d75 100644 --- a/types/node/child_process.d.ts +++ b/types/node/child_process.d.ts @@ -125,7 +125,7 @@ declare module "child_process" { } interface SpawnOptionsWithoutStdio extends SpawnOptions { - stdio?: 'pipe' | Array; + stdio?: 'pipe' | Array; } function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams; diff --git a/types/node/test/child_process.ts b/types/node/test/child_process.ts index 0172ee71c4..e0289ba183 100644 --- a/types/node/test/child_process.ts +++ b/types/node/test/child_process.ts @@ -293,12 +293,14 @@ async function testPromisify() { expectNonNull(childProcess.spawn('command', { stdio: undefined })); expectNonNull(childProcess.spawn('command', { stdio: 'pipe' })); expectNonNull(childProcess.spawn('command', { stdio: [undefined, undefined, undefined] })); + expectNonNull(childProcess.spawn('command', { stdio: [null, null, null] })); expectNonNull(childProcess.spawn('command', { stdio: ['pipe', 'pipe', 'pipe'] })); expectNonNull(childProcess.spawn('command', ['a', 'b', 'c'])); expectNonNull(childProcess.spawn('command', ['a', 'b', 'c'], {})); expectNonNull(childProcess.spawn('command', ['a', 'b', 'c'], { stdio: undefined })); expectNonNull(childProcess.spawn('command', ['a', 'b', 'c'], { stdio: 'pipe' })); 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'] })); } {