test: avoid real waits in cdp and outbound tests

This commit is contained in:
Peter Steinberger
2026-05-06 05:43:44 +01:00
parent cbaf999bd2
commit 6da5eda488
2 changed files with 38 additions and 1 deletions

View File

@@ -963,6 +963,22 @@ describe("cdp internal", () => {
const msg = JSON.parse(rawDataToString(raw)) as { id?: number; method?: string };
if (msg.method === "Target.createTarget") {
socket.send(JSON.stringify({ id: msg.id, result: { targetId: "T_BARE_WS" } }));
return;
}
if (msg.method === "Target.attachToTarget") {
socket.send(JSON.stringify({ id: msg.id, result: { sessionId: "S_BARE_WS" } }));
return;
}
if (
msg.method === "Page.enable" ||
msg.method === "Runtime.enable" ||
msg.method === "Network.enable" ||
msg.method === "DOM.enable" ||
msg.method === "Accessibility.enable" ||
msg.method === "Runtime.runIfWaitingForDebugger" ||
msg.method === "Target.detachFromTarget"
) {
socket.send(JSON.stringify({ id: msg.id, result: {} }));
}
});
});