Skip to content

Commit 44bf632

Browse files
committed
Revert "chore: fix types"
This reverts commit 691ddf4.
1 parent 84997ed commit 44bf632

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

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

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { rm, stat } from 'fs/promises';
22
import { dirname, join } from 'path';
3+
import type { ExecaError, ExecaReturnValue } from 'execa';
34
import { execaNode } from 'execa';
45
import copy from 'cpy';
56
import { temporaryDirectory } from 'tempy';
@@ -14,19 +15,23 @@ export default async function withFixture(
1415
fixture: string,
1516
callback: (api: {
1617
dir: string;
17-
run: (args: readonly string[]) => Promise<{
18-
stdout: string;
19-
stderr: string;
20-
exitCode?: number;
21-
}>;
18+
run: (
19+
args: readonly string[],
20+
) => Promise<{ stdout: string; stderr: string; exitCode: number }>;
2221
}) => Promise<void>,
2322
): Promise<void> {
2423
const tempDir = temporaryDirectory();
2524

26-
async function run(args: readonly string[]) {
27-
return await execaNode(cliBinary, args, {
28-
cwd: tempDir,
29-
});
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+
}
3035
}
3136

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

0 commit comments

Comments
 (0)