mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user