mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 23:50:42 +00:00
test: tighten provider usage plugin assertions
This commit is contained in:
@@ -60,15 +60,23 @@ describe("provider-usage.load plugin boundary", () => {
|
||||
});
|
||||
|
||||
expect(mockFetch).not.toHaveBeenCalled();
|
||||
expect(resolveProviderUsageSnapshotWithPluginMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
provider: "github-copilot",
|
||||
context: expect.objectContaining({
|
||||
provider: "github-copilot",
|
||||
token: "copilot-token",
|
||||
timeoutMs: 5_000,
|
||||
}),
|
||||
}),
|
||||
);
|
||||
expect(resolveProviderUsageSnapshotWithPluginMock).toHaveBeenCalledOnce();
|
||||
const pluginCall = resolveProviderUsageSnapshotWithPluginMock.mock.calls[0]?.[0] as
|
||||
| {
|
||||
provider?: unknown;
|
||||
context?: {
|
||||
provider?: unknown;
|
||||
token?: unknown;
|
||||
timeoutMs?: unknown;
|
||||
};
|
||||
}
|
||||
| undefined;
|
||||
if (!pluginCall) {
|
||||
throw new Error("missing provider usage plugin call");
|
||||
}
|
||||
expect(pluginCall.provider).toBe("github-copilot");
|
||||
expect(pluginCall.context?.provider).toBe("github-copilot");
|
||||
expect(pluginCall.context?.token).toBe("copilot-token");
|
||||
expect(pluginCall.context?.timeoutMs).toBe(5_000);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user