Skip to content

Commit ca88bcf

Browse files
committed
style: format worker-touched test files and drop an unused mock parameter
1 parent 8a603c1 commit ca88bcf

10 files changed

Lines changed: 153 additions & 96 deletions

‎src/agent/exa-web-fetch-alias.test.ts‎

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,11 @@ describe("built-in Exa web_fetch alias", () => {
284284
resolveMcpServers([{ name: "exa", enabled: false }], undefined),
285285
);
286286
const states: string[] = [];
287-
const connection = toolset.connectMCPServer(
288-
linearHttpMcpServer,
289-
{
290-
interactiveAuth: true,
291-
onStatus: (status) => states.push(status.state),
292-
onToolsChanged: () => undefined,
293-
},
294-
);
287+
const connection = toolset.connectMCPServer(linearHttpMcpServer, {
288+
interactiveAuth: true,
289+
onStatus: (status) => states.push(status.state),
290+
onToolsChanged: () => undefined,
291+
});
295292
await Promise.resolve();
296293

297294
let disposed = false;
@@ -434,14 +431,11 @@ describe("built-in Exa web_fetch alias", () => {
434431
);
435432
const states: { state: string; error?: string }[] = [];
436433
try {
437-
await toolset.connectMCPServer(
438-
linearHttpMcpServer,
439-
{
440-
interactiveAuth: true,
441-
onStatus: (status) => states.push(status),
442-
onToolsChanged: () => undefined,
443-
},
444-
);
434+
await toolset.connectMCPServer(linearHttpMcpServer, {
435+
interactiveAuth: true,
436+
onStatus: (status) => states.push(status),
437+
onToolsChanged: () => undefined,
438+
});
445439

446440
expect(states.map((status) => status.state)).toEqual([
447441
"connecting",
@@ -537,9 +531,7 @@ describe("built-in Exa web_fetch alias", () => {
537531
expect(states[1]?.error).toContain("connection exploded");
538532
expect(toolset.hasMCPServer("linear")).toBe(false);
539533
expect(await Bun.file(path).json()).toMatchObject({
540-
mcpServers: [
541-
linearHttpMcpServer,
542-
],
534+
mcpServers: [linearHttpMcpServer],
543535
});
544536
expect(
545537
await persistGlobalHTTPMCPServer(
@@ -561,9 +553,7 @@ describe("built-in Exa web_fetch alias", () => {
561553
expect(retryStates).toEqual(["connecting", "connected"]);
562554
expect(toolset.hasMCPServer("linear")).toBe(true);
563555
expect(await Bun.file(path).json()).toMatchObject({
564-
mcpServers: [
565-
linearHttpMcpServer,
566-
],
556+
mcpServers: [linearHttpMcpServer],
567557
});
568558
} finally {
569559
await toolset.dispose();

‎src/agent/tools-mcp-disconnect.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import { afterEach, beforeEach, describe, expect, jest, test } from "bun:test";
22
import { mkdtempSync, rmSync } from "node:fs";
33
import { tmpdir } from "node:os";
44
import { join } from "node:path";
5-
import { installMcpConnectMock, mcpTestPermissionGate } from "../testkit/mcp-connect-mock.js";
5+
import {
6+
installMcpConnectMock,
7+
mcpTestPermissionGate,
8+
} from "../testkit/mcp-connect-mock.js";
69
import type { MCPServerState } from "./tools.js";
710

811
const dirs: string[] = [];

‎src/config.test.ts‎

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -633,12 +633,7 @@ describe("loadConfig", () => {
633633
"fireworks",
634634
"hello",
635635
]);
636-
const modelFirst = await loadFor(cwd, [
637-
"--model",
638-
model,
639-
"-p",
640-
"hello",
641-
]);
636+
const modelFirst = await loadFor(cwd, ["--model", model, "-p", "hello"]);
642637
const directorFirst = await loadFor(cwd, [
643638
"--director",
644639
"skywalker",
@@ -1151,14 +1146,11 @@ describe("loadConfig", () => {
11511146
join(cwd, ".corbits", "profile.json"),
11521147
JSON.stringify({ model: "profile-model" }),
11531148
);
1154-
const config = await loadFor(
1155-
cwd,
1156-
[
1157-
"--model",
1158-
"accounts/fireworks/routers/kimi-k2p6-turbo",
1159-
"task",
1160-
],
1161-
);
1149+
const config = await loadFor(cwd, [
1150+
"--model",
1151+
"accounts/fireworks/routers/kimi-k2p6-turbo",
1152+
"task",
1153+
]);
11621154
expect(config.model).toBe("accounts/fireworks/routers/kimi-k2p6-turbo");
11631155
});
11641156

‎src/mcp/client-auth-reauth-cap.test.ts‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -306,17 +306,13 @@ async function runCappedEpisodes(
306306
connected.client.call("ping", {}, new AbortController().signal),
307307
).rejects.toThrow("finishAuth exploded");
308308
}
309-
expect(mock.authURLCount).toBe(
310-
authURLsBefore + MAX_BROWSER_AUTH_ATTEMPTS,
311-
);
309+
expect(mock.authURLCount).toBe(authURLsBefore + MAX_BROWSER_AUTH_ATTEMPTS);
312310

313311
mock.callFailuresLeft = 1;
314312
await expect(
315313
connected.client.call("ping", {}, new AbortController().signal),
316314
).rejects.toThrow("retrying paused");
317-
expect(mock.authURLCount).toBe(
318-
authURLsBefore + MAX_BROWSER_AUTH_ATTEMPTS,
319-
);
315+
expect(mock.authURLCount).toBe(authURLsBefore + MAX_BROWSER_AUTH_ATTEMPTS);
320316
}
321317

322318
/** Connect-path twin of runCappedEpisodes for the episodes themselves. */

‎src/settings.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,9 @@ describe("loaders", () => {
654654

655655
test("loadSettings throws on an invalid schema", async () => {
656656
await withTempDir("ic-settings-", async (dir) => {
657-
const path = await writeSettings(dir, { providers: { x: { models: [] } } });
657+
const path = await writeSettings(dir, {
658+
providers: { x: { models: [] } },
659+
});
658660
await expect(loadSettings(path)).rejects.toThrow(
659661
/Invalid settings schema/,
660662
);

‎src/subagent/index.test.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ describe("sub-agent stop helpers", () => {
201201
"## Paths",
202202
].join("\n");
203203

204-
205204
const WRAP_PLAN_ENVELOPE = [
206205
"## Summary",
207206
"Plan after reading the gate.",

0 commit comments

Comments
 (0)