Skip to content

Commit 516de8d

Browse files
committed
chore: proper fix types
1 parent 44bf632 commit 516de8d

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

packages/react-docgen-cli/tests/integration/utils/withFixture.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { rm, stat } from 'fs/promises';
22
import { dirname, join } from 'path';
3-
import type { ExecaError, ExecaReturnValue } from 'execa';
43
import { execaNode } from 'execa';
54
import copy from 'cpy';
65
import { temporaryDirectory } from 'tempy';
@@ -17,21 +16,17 @@ export default async function withFixture(
1716
dir: string;
1817
run: (
1918
args: readonly string[],
20-
) => Promise<{ stdout: string; stderr: string; exitCode: number }>;
19+
) => Promise<{ stdout: string; stderr: string; exitCode?: number }>;
2120
}) => Promise<void>,
2221
): Promise<void> {
2322
const tempDir = temporaryDirectory();
2423

25-
async function run(
26-
args: readonly string[],
27-
): Promise<ExecaError | ExecaReturnValue<string>> {
28-
try {
29-
return await execaNode(cliBinary, args, {
30-
cwd: tempDir,
31-
});
32-
} catch (error) {
33-
return error as ExecaError;
34-
}
24+
async function run(args: readonly string[]) {
25+
return execaNode(cliBinary, args, {
26+
cwd: tempDir,
27+
lines: false,
28+
reject: false,
29+
});
3530
}
3631

3732
await stat(join(fixtureDir, fixture));

0 commit comments

Comments
 (0)