Skip to content

Commit 3907629

Browse files
committed
test: tighten status runtime assertions
1 parent c2f4f25 commit 3907629

1 file changed

Lines changed: 20 additions & 14 deletions

File tree

src/commands/status-runtime-shared.test.ts

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,16 @@ describe("status-runtime-shared", () => {
107107
config: { gateway: {} },
108108
});
109109

110-
expect(mocks.loadProviderUsageSummary).toHaveBeenCalledWith(
111-
expect.objectContaining({
112-
timeoutMs: 1234,
113-
config: { gateway: {} },
114-
agentDir: expect.stringContaining("main"),
115-
}),
116-
);
110+
const usageCall = mocks.loadProviderUsageSummary.mock.calls[0]?.[0] as
111+
| {
112+
timeoutMs?: number;
113+
config?: unknown;
114+
agentDir?: string;
115+
}
116+
| undefined;
117+
expect(usageCall?.timeoutMs).toBe(1234);
118+
expect(usageCall?.config).toEqual({ gateway: {} });
119+
expect(usageCall?.agentDir).toContain("main");
117120
});
118121

119122
it("resolves usage summaries with explicit agent scope", async () => {
@@ -228,13 +231,16 @@ describe("status-runtime-shared", () => {
228231
gatewayService: { label: "LaunchAgent" },
229232
nodeService: { label: "node" },
230233
});
231-
expect(mocks.loadProviderUsageSummary).toHaveBeenCalledWith(
232-
expect.objectContaining({
233-
timeoutMs: 1234,
234-
config: { gateway: {} },
235-
agentDir: expect.stringContaining("main"),
236-
}),
237-
);
234+
const usageCall = mocks.loadProviderUsageSummary.mock.calls[0]?.[0] as
235+
| {
236+
timeoutMs?: number;
237+
config?: unknown;
238+
agentDir?: string;
239+
}
240+
| undefined;
241+
expect(usageCall?.timeoutMs).toBe(1234);
242+
expect(usageCall?.config).toEqual({ gateway: {} });
243+
expect(usageCall?.agentDir).toContain("main");
238244
expect(mocks.callGateway).toHaveBeenNthCalledWith(1, {
239245
method: "health",
240246
params: { probe: true },

0 commit comments

Comments
 (0)