Cover invalid shell.openInEditor payload errors
Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
ff82a2c6c2
commit
0e1f3844bf
1 file changed
+29
@@ -564,6 +564,35 @@ describe("runtimeApiServer", () => {
|
||||
client.socket.close();
|
||||
});
|
||||
|
||||
it("returns structured errors for invalid shell.openInEditor payloads", async () => {
|
||||
const server = await startRuntimeApiServer({
|
||||
port: 0,
|
||||
launchCwd: process.cwd(),
|
||||
});
|
||||
servers.push(server);
|
||||
|
||||
const client = await connectClient(server.wsUrl);
|
||||
await client.nextMessage();
|
||||
|
||||
const response = await sendRequest(
|
||||
client.socket,
|
||||
client.nextMessage,
|
||||
"shell-invalid-1",
|
||||
"shell.openInEditor",
|
||||
{
|
||||
cwd: "/workspace",
|
||||
editor: "unknown-editor",
|
||||
},
|
||||
);
|
||||
expect(response.ok).toBe(false);
|
||||
if (response.ok) {
|
||||
throw new Error("Expected invalid shell payload to fail.");
|
||||
}
|
||||
expect(response.error?.code).toBe("request_failed");
|
||||
|
||||
client.socket.close();
|
||||
});
|
||||
|
||||
it("reports runtime health metadata", async () => {
|
||||
const server = await startRuntimeApiServer({
|
||||
port: 0,
|
||||
|
||||
Reference in new issue
Block a user