Skip to content

Commit b9f5d35

Browse files
committed
Simplify spawn command
1 parent 65bd194 commit b9f5d35

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

apps/test-app/scripts/fake-tests.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from "node:path";
22

3-
import { spawn } from "bufout";
3+
import { spawn, SpawnFailure } from "bufout";
44
import { Client } from "mocha-remote-client";
55

66
const cwd = path.resolve(__dirname, "..");
@@ -9,7 +9,7 @@ const env = {
99
FORCE_COLOR: "1",
1010
};
1111

12-
const metro = spawn("npx", ["react-native", "start", "--no-interactive"], {
12+
const metro = spawn("react-native", ["start", "--no-interactive"], {
1313
cwd,
1414
stdio: "inherit",
1515
outputPrefix: "[metro] ",
@@ -35,4 +35,8 @@ const client = new Client({
3535
},
3636
});
3737

38-
metro.catch(console.error);
38+
metro.catch((err) => {
39+
if (!(err instanceof SpawnFailure)) {
40+
throw err;
41+
}
42+
});

0 commit comments

Comments
 (0)