chore: Enable "curly" rule to avoid single-statement if confusion/errors.

This commit is contained in:
cpojer
2026-01-31 16:19:20 +09:00
parent 009b16fab8
commit 5ceff756e1
1266 changed files with 27871 additions and 9393 deletions

View File

@@ -94,7 +94,9 @@ describe("session_status tool", () => {
(candidate) => candidate.name === "session_status",
);
expect(tool).toBeDefined();
if (!tool) throw new Error("missing session_status tool");
if (!tool) {
throw new Error("missing session_status tool");
}
const result = await tool.execute("call1", {});
const details = result.details as { ok?: boolean; statusText?: string };
@@ -115,7 +117,9 @@ describe("session_status tool", () => {
(candidate) => candidate.name === "session_status",
);
expect(tool).toBeDefined();
if (!tool) throw new Error("missing session_status tool");
if (!tool) {
throw new Error("missing session_status tool");
}
await expect(tool.execute("call2", { sessionKey: "nope" })).rejects.toThrow(
"Unknown sessionId",
@@ -138,7 +142,9 @@ describe("session_status tool", () => {
(candidate) => candidate.name === "session_status",
);
expect(tool).toBeDefined();
if (!tool) throw new Error("missing session_status tool");
if (!tool) {
throw new Error("missing session_status tool");
}
const result = await tool.execute("call3", { sessionKey: sessionId });
const details = result.details as { ok?: boolean; sessionKey?: string };
@@ -160,7 +166,9 @@ describe("session_status tool", () => {
(candidate) => candidate.name === "session_status",
);
expect(tool).toBeDefined();
if (!tool) throw new Error("missing session_status tool");
if (!tool) {
throw new Error("missing session_status tool");
}
const result = await tool.execute("call4", { sessionKey: "temp:slug-generator" });
const details = result.details as { ok?: boolean; sessionKey?: string };
@@ -182,7 +190,9 @@ describe("session_status tool", () => {
(candidate) => candidate.name === "session_status",
);
expect(tool).toBeDefined();
if (!tool) throw new Error("missing session_status tool");
if (!tool) {
throw new Error("missing session_status tool");
}
await expect(tool.execute("call5", { sessionKey: "agent:other:main" })).rejects.toThrow(
"Agent-to-agent status is disabled",
@@ -222,7 +232,9 @@ describe("session_status tool", () => {
(candidate) => candidate.name === "session_status",
);
expect(tool).toBeDefined();
if (!tool) throw new Error("missing session_status tool");
if (!tool) {
throw new Error("missing session_status tool");
}
const result = await tool.execute("call6", { sessionKey: "main" });
const details = result.details as { ok?: boolean; sessionKey?: string };
@@ -247,7 +259,9 @@ describe("session_status tool", () => {
(candidate) => candidate.name === "session_status",
);
expect(tool).toBeDefined();
if (!tool) throw new Error("missing session_status tool");
if (!tool) {
throw new Error("missing session_status tool");
}
await tool.execute("call3", { model: "default" });
expect(updateSessionStoreMock).toHaveBeenCalled();