feat: add remote CDP browser support
This commit is contained in:
@@ -163,7 +163,9 @@ describe("browser chrome helpers", () => {
|
||||
json: async () => ({ webSocketDebuggerUrl: "ws://127.0.0.1/devtools" }),
|
||||
} as unknown as Response),
|
||||
);
|
||||
await expect(isChromeReachable(12345, 50)).resolves.toBe(true);
|
||||
await expect(isChromeReachable("http://127.0.0.1:12345", 50)).resolves.toBe(
|
||||
true,
|
||||
);
|
||||
|
||||
vi.stubGlobal(
|
||||
"fetch",
|
||||
@@ -172,10 +174,14 @@ describe("browser chrome helpers", () => {
|
||||
json: async () => ({}),
|
||||
} as unknown as Response),
|
||||
);
|
||||
await expect(isChromeReachable(12345, 50)).resolves.toBe(false);
|
||||
await expect(isChromeReachable("http://127.0.0.1:12345", 50)).resolves.toBe(
|
||||
false,
|
||||
);
|
||||
|
||||
vi.stubGlobal("fetch", vi.fn().mockRejectedValue(new Error("boom")));
|
||||
await expect(isChromeReachable(12345, 50)).resolves.toBe(false);
|
||||
await expect(isChromeReachable("http://127.0.0.1:12345", 50)).resolves.toBe(
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
it("stopClawdChrome no-ops when process is already killed", async () => {
|
||||
|
||||
Reference in New Issue
Block a user