Skip to content

Commit

Permalink
Fix incorrect execaNode signature in index.d.ts (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
forivall committed Feb 11, 2023
1 parent e331353 commit 1f7677c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.d.ts
Expand Up @@ -575,7 +575,7 @@ export function execaNode(
export function execaNode(
scriptPath: string,
arguments?: readonly string[],
options?: Options<null>
options?: NodeOptions<null>
): ExecaChildProcess<Buffer>;
export function execaNode(scriptPath: string, options?: Options): ExecaChildProcess;
export function execaNode(scriptPath: string, options?: Options<null>): ExecaChildProcess<Buffer>;
export function execaNode(scriptPath: string, options?: NodeOptions): ExecaChildProcess;
export function execaNode(scriptPath: string, options?: NodeOptions<null>): ExecaChildProcess<Buffer>;
9 changes: 9 additions & 0 deletions index.test-d.ts
Expand Up @@ -210,3 +210,12 @@ expectType<ExecaReturnValue>(
expectType<ExecaReturnValue<Buffer>>(
await execaNode('unicorns', ['foo'], {encoding: null}),
);

expectType<ExecaChildProcess>(execaNode('unicorns', {nodeOptions: ['--async-stack-traces']}));
expectType<ExecaChildProcess>(execaNode('unicorns', ['foo'], {nodeOptions: ['--async-stack-traces']}));
expectType<ExecaChildProcess<Buffer>>(
execaNode('unicorns', {nodeOptions: ['--async-stack-traces'], encoding: null}),
);
expectType<ExecaChildProcess<Buffer>>(
execaNode('unicorns', ['foo'], {nodeOptions: ['--async-stack-traces'], encoding: null}),
);

0 comments on commit 1f7677c

Please sign in to comment.