mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 18:04:45 +00:00
test: tighten status runtime assertions
This commit is contained in:
@@ -107,13 +107,16 @@ describe("status-runtime-shared", () => {
|
||||
config: { gateway: {} },
|
||||
});
|
||||
|
||||
expect(mocks.loadProviderUsageSummary).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
timeoutMs: 1234,
|
||||
config: { gateway: {} },
|
||||
agentDir: expect.stringContaining("main"),
|
||||
}),
|
||||
);
|
||||
const usageCall = mocks.loadProviderUsageSummary.mock.calls[0]?.[0] as
|
||||
| {
|
||||
timeoutMs?: number;
|
||||
config?: unknown;
|
||||
agentDir?: string;
|
||||
}
|
||||
| undefined;
|
||||
expect(usageCall?.timeoutMs).toBe(1234);
|
||||
expect(usageCall?.config).toEqual({ gateway: {} });
|
||||
expect(usageCall?.agentDir).toContain("main");
|
||||
});
|
||||
|
||||
it("resolves usage summaries with explicit agent scope", async () => {
|
||||
@@ -228,13 +231,16 @@ describe("status-runtime-shared", () => {
|
||||
gatewayService: { label: "LaunchAgent" },
|
||||
nodeService: { label: "node" },
|
||||
});
|
||||
expect(mocks.loadProviderUsageSummary).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
timeoutMs: 1234,
|
||||
config: { gateway: {} },
|
||||
agentDir: expect.stringContaining("main"),
|
||||
}),
|
||||
);
|
||||
const usageCall = mocks.loadProviderUsageSummary.mock.calls[0]?.[0] as
|
||||
| {
|
||||
timeoutMs?: number;
|
||||
config?: unknown;
|
||||
agentDir?: string;
|
||||
}
|
||||
| undefined;
|
||||
expect(usageCall?.timeoutMs).toBe(1234);
|
||||
expect(usageCall?.config).toEqual({ gateway: {} });
|
||||
expect(usageCall?.agentDir).toContain("main");
|
||||
expect(mocks.callGateway).toHaveBeenNthCalledWith(1, {
|
||||
method: "health",
|
||||
params: { probe: true },
|
||||
|
||||
Reference in New Issue
Block a user