Skip to content

Commit 956853f

Browse files
authored
test: dont overwrite root package.json when running bun-ipc-inherit.test.ts (#15126)
1 parent c5df329 commit 956853f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: test/js/bun/spawn/bun-ipc-inherit.test.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { spawn } from "bun";
22
import { expect, it } from "bun:test";
3-
import { bunExe, isWindows } from "harness";
3+
import { bunExe, isWindows, tmpdirSync } from "harness";
44
import fs from "node:fs/promises";
55
import path from "path";
66

77
it.todoIf(isWindows)("spawning a bun package script should inherit the ipc fd", async () => {
8+
const x = tmpdirSync();
89
await fs.writeFile(
9-
path.join(process.cwd(), "package.json"),
10+
path.join(x, "package.json"),
1011
JSON.stringify({
1112
scripts: {
1213
test: `${bunExe()} -e 'process.send("hello")'`,
@@ -21,6 +22,7 @@ it.todoIf(isWindows)("spawning a bun package script should inherit the ipc fd",
2122
testMessage = message;
2223
},
2324
stdio: ["inherit", "inherit", "inherit"],
25+
cwd: x,
2426
});
2527

2628
await child.exited;

0 commit comments

Comments
 (0)