feat(cli): manage workspace scripts (#1992)
* feat(cli): manage workspace scripts * docs: document workspace script management --------- Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
This commit is contained in:
co-authored by
Mohamed Boudra
parent
21597bdc1b
commit
21404fbdec
@@ -622,6 +622,42 @@ describe("workspace message schemas", () => {
|
||||
expect(parsed.payload.workspace.workspaceKind).toBe("directory");
|
||||
});
|
||||
|
||||
test("parses workspace script management request and response payloads", () => {
|
||||
expect(
|
||||
SessionInboundMessageSchema.parse({
|
||||
type: "workspace.script.stop.request",
|
||||
requestId: "req-script-stop",
|
||||
workspaceId: "ws-repo",
|
||||
scriptName: "web",
|
||||
}),
|
||||
).toMatchObject({ type: "workspace.script.stop.request", scriptName: "web" });
|
||||
|
||||
expect(
|
||||
SessionOutboundMessageSchema.parse({
|
||||
type: "workspace.script.start.response",
|
||||
payload: {
|
||||
requestId: "req-script-start",
|
||||
workspaceId: "ws-repo",
|
||||
scriptName: "web",
|
||||
script: {
|
||||
scriptName: "web",
|
||||
type: "service",
|
||||
hostname: "web--repo.localhost",
|
||||
port: 3000,
|
||||
proxyUrl: "http://web--repo.localhost:6767",
|
||||
lifecycle: "running",
|
||||
health: "healthy",
|
||||
terminalId: "terminal-1",
|
||||
},
|
||||
error: null,
|
||||
},
|
||||
}),
|
||||
).toMatchObject({
|
||||
type: "workspace.script.start.response",
|
||||
payload: { script: { terminalId: "terminal-1", lifecycle: "running" } },
|
||||
});
|
||||
});
|
||||
|
||||
test("parses script_status_update payload", () => {
|
||||
const parsed = SessionOutboundMessageSchema.parse({
|
||||
type: "script_status_update",
|
||||
|
||||
Reference in New Issue
Block a user