Cover non-zero terminal exit semantics in runtime tests
Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
1 parent
4d90913dcb
commit
0a83664bbd
1 file changed
+35
@@ -965,6 +965,41 @@ describe("runtimeApiServer", () => {
|
||||
client.socket.close();
|
||||
});
|
||||
|
||||
it("returns non-zero terminal exit codes without request failure", 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,
|
||||
"terminal-exit-code-1",
|
||||
"terminal.run",
|
||||
{
|
||||
command: "exit 3",
|
||||
cwd: process.cwd(),
|
||||
},
|
||||
);
|
||||
expect(response.ok).toBe(true);
|
||||
if (!response.ok) {
|
||||
throw new Error("Expected terminal non-zero exit response to succeed.");
|
||||
}
|
||||
|
||||
const payload = response.result as {
|
||||
code: number | null;
|
||||
timedOut: boolean;
|
||||
};
|
||||
expect(payload.code).toBe(3);
|
||||
expect(payload.timedOut).toBe(false);
|
||||
|
||||
client.socket.close();
|
||||
});
|
||||
|
||||
it("supports todo mutation lifecycle over websocket RPC", async () => {
|
||||
const server = await startRuntimeApiServer({
|
||||
port: 0,
|
||||
|
||||
Reference in new issue
Block a user