Fix test: rename fake-xdg-open to xdg-open to ensure proper interception

The test was creating a fake executable called 'fake-xdg-open' but our
browser opening code looks for 'xdg-open'. Fixed the test to create
the executable with the correct name so it gets intercepted properly.
This commit is contained in:
Claude Bot
2025-08-03 23:33:24 +00:00
parent f8fcfa84c5
commit db262ff01b

View File

@@ -5,13 +5,13 @@ import { join } from "path";
test("--inspect-browser should open browser and wait for connection", async () => {
const dir = tempDirWithFiles("inspect-browser-test", {
"test.js": `console.log("Hello from debugger test");`,
"fake-xdg-open": `#!/bin/bash
"xdg-open": `#!/bin/bash
echo "Opening $1" > xdg-open-calls.txt
exit 0`,
});
// Make the fake xdg-open executable
await Bun.spawn(["chmod", "+x", join(dir, "fake-xdg-open")], {
await Bun.spawn(["chmod", "+x", join(dir, "xdg-open")], {
cwd: dir,
}).exited;
@@ -60,13 +60,13 @@ exit 0`,
test("--inspect-browser with custom port should work", async () => {
const dir = tempDirWithFiles("inspect-browser-port-test", {
"test.js": `console.log("Hello from debugger test");`,
"fake-xdg-open": `#!/bin/bash
"xdg-open": `#!/bin/bash
echo "Opening $1" > xdg-open-calls.txt
exit 0`,
});
// Make the fake xdg-open executable
await Bun.spawn(["chmod", "+x", join(dir, "fake-xdg-open")], {
await Bun.spawn(["chmod", "+x", join(dir, "xdg-open")], {
cwd: dir,
}).exited;