Skip to content

Commit 3b865b9

Browse files
authored
Merge pull request #46 from scalvert/fix-signature
2 parents ef04776 + dc69fcb commit 3b865b9

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

src/create-bin-tester.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,35 @@ interface RunBin {
3535
*/
3636
(): execa.ExecaChildProcess<string>;
3737
/**
38-
* A runBin implementation that takes varargs.
38+
* A runBin implementation that takes string varargs.
3939
*
4040
* @param {...RunBinArgs} args
4141
* @returns {*} {execa.ExecaChildProcess<string>}
4242
* @memberof RunBin
4343
*/
44-
(...args: RunBinArgs): execa.ExecaChildProcess<string>;
44+
(...args: [...binArgs: string[]]): execa.ExecaChildProcess<string>;
45+
/**
46+
* A runBin implementation that takes an execa.Options<string> object.
47+
*
48+
* @param {...RunBinArgs} args
49+
* @returns {*} {execa.ExecaChildProcess<string>}
50+
* @memberof RunBin
51+
*/
52+
(...args: [execaOptions: execa.Options<string>]): execa.ExecaChildProcess<string>;
53+
/**
54+
* A runBin implementation that takes string or an execa.Options<string> object varargs.
55+
*
56+
* @param {...RunBinArgs} args
57+
* @returns {*} {execa.ExecaChildProcess<string>}
58+
* @memberof RunBin
59+
*/
60+
(
61+
...args: [...binArgs: string[], execaOptions: execa.Options<string>]
62+
): execa.ExecaChildProcess<string>;
4563
}
4664

65+
type RunBinArgs = (string | execa.Options<string>)[];
66+
4767
interface CreateBinTesterResult<TProject extends BinTesterProject> {
4868
/**
4969
* Runs the configured bin function via execa.
@@ -63,8 +83,6 @@ interface CreateBinTesterResult<TProject extends BinTesterProject> {
6383
teardownProject: () => void;
6484
}
6585

66-
type RunBinArgs = [...binArgs: string[], execaOptions: execa.Options<string>];
67-
6886
const DEFAULT_BIN_TESTER_OPTIONS = {
6987
staticArgs: [],
7088
};

0 commit comments

Comments
 (0)