Cover providers.listSessions success path in runtime tests

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 00:02:38 +00:00
1 parent cef4be1258
commit 7a515bc5e4
1 file changed
+25
+25
View File
@@ -247,6 +247,31 @@ describe("runtimeApiServer", () => {
client.socket.close();
});
it("responds to providers.listSessions over websocket RPC", 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,
"providers-list-1",
"providers.listSessions",
);
expect(response.ok).toBe(true);
if (!response.ok) {
throw new Error("Expected providers.listSessions response to succeed.");
}
expect(Array.isArray(response.result)).toBe(true);
client.socket.close();
});
it("ignores malformed client messages and continues processing", async () => {
const server = await startRuntimeApiServer({
port: 0,