mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 16:38:27 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -148,7 +148,9 @@ describe("image tool implicit imageModel config", () => {
|
||||
};
|
||||
const tool = createImageTool({ config: cfg, agentDir, sandboxRoot });
|
||||
expect(tool).not.toBeNull();
|
||||
if (!tool) throw new Error("expected image tool");
|
||||
if (!tool) {
|
||||
throw new Error("expected image tool");
|
||||
}
|
||||
|
||||
await expect(tool.execute("t1", { image: "https://example.com/a.png" })).rejects.toThrow(
|
||||
/Sandboxed image tool does not allow remote URLs/i,
|
||||
@@ -198,7 +200,9 @@ describe("image tool implicit imageModel config", () => {
|
||||
};
|
||||
const tool = createImageTool({ config: cfg, agentDir, sandboxRoot });
|
||||
expect(tool).not.toBeNull();
|
||||
if (!tool) throw new Error("expected image tool");
|
||||
if (!tool) {
|
||||
throw new Error("expected image tool");
|
||||
}
|
||||
|
||||
const res = await tool.execute("t1", {
|
||||
prompt: "Describe the image.",
|
||||
@@ -266,7 +270,9 @@ describe("image tool MiniMax VLM routing", () => {
|
||||
};
|
||||
const tool = createImageTool({ config: cfg, agentDir });
|
||||
expect(tool).not.toBeNull();
|
||||
if (!tool) throw new Error("expected image tool");
|
||||
if (!tool) {
|
||||
throw new Error("expected image tool");
|
||||
}
|
||||
|
||||
const res = await tool.execute("t1", {
|
||||
prompt: "Describe the image.",
|
||||
@@ -308,7 +314,9 @@ describe("image tool MiniMax VLM routing", () => {
|
||||
};
|
||||
const tool = createImageTool({ config: cfg, agentDir });
|
||||
expect(tool).not.toBeNull();
|
||||
if (!tool) throw new Error("expected image tool");
|
||||
if (!tool) {
|
||||
throw new Error("expected image tool");
|
||||
}
|
||||
|
||||
await expect(
|
||||
tool.execute("t1", {
|
||||
|
||||
Reference in New Issue
Block a user