Skip to content

Commit a165f7b

Browse files
committed
fix(ci): repair agent test mocks
1 parent 9dc4a27 commit a165f7b

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

src/agents/command/session.resolve-session-key.test.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ const hoisted = vi.hoisted(() => ({
77
listAgentIdsMock: vi.fn<() => string[]>(),
88
}));
99

10-
vi.mock("../../config/sessions.js", async () => {
11-
const actual = await vi.importActual<typeof import("../../config/sessions.js")>(
12-
"../../config/sessions.js",
13-
);
14-
return {
15-
...actual,
16-
loadSessionStore: (storePath: string) => hoisted.loadSessionStoreMock(storePath),
17-
resolveStorePath: (store?: string, params?: { agentId?: string }) =>
18-
`/stores/${params?.agentId ?? "main"}.json`,
19-
resolveAgentIdFromSessionKey: () => "main",
20-
resolveExplicitAgentSessionKey: () => undefined,
21-
};
22-
});
10+
vi.mock("../../config/sessions/store-load.js", () => ({
11+
loadSessionStore: (storePath: string) => hoisted.loadSessionStoreMock(storePath),
12+
}));
13+
14+
vi.mock("../../config/sessions/paths.js", () => ({
15+
resolveStorePath: (_store?: string, params?: { agentId?: string }) =>
16+
`/stores/${params?.agentId ?? "main"}.json`,
17+
}));
18+
19+
vi.mock("../../config/sessions/main-session.js", () => ({
20+
resolveAgentIdFromSessionKey: () => "main",
21+
resolveExplicitAgentSessionKey: () => undefined,
22+
}));
2323

2424
vi.mock("../agent-scope.js", () => ({
2525
listAgentIds: () => hoisted.listAgentIdsMock(),

src/agents/model-fallback.probe.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ vi.mock("./auth-profiles/order.js", () => ({
2121
resolveAuthProfileOrder: vi.fn(),
2222
}));
2323

24+
vi.mock("./auth-profiles/source-check.js", () => ({
25+
hasAnyAuthProfileStoreSource: vi.fn(() => true),
26+
}));
27+
2428
type AuthProfilesStoreModule = typeof import("./auth-profiles/store.js");
2529
type AuthProfilesUsageModule = typeof import("./auth-profiles/usage.js");
2630
type AuthProfilesOrderModule = typeof import("./auth-profiles/order.js");

0 commit comments

Comments
 (0)