mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-10 16:51:13 +00:00
test: fix plugin stream typing assertions
This commit is contained in:
@@ -85,7 +85,9 @@ describe("openrouter provider hooks", () => {
|
||||
);
|
||||
|
||||
expect(baseStreamFn).toHaveBeenCalledOnce();
|
||||
expect(baseStreamFn.mock.calls[0]?.[0]).toMatchObject({
|
||||
const firstCall = baseStreamFn.mock.calls[0];
|
||||
const firstModel = firstCall?.[0];
|
||||
expect(firstModel).toMatchObject({
|
||||
compat: {
|
||||
openRouterRouting: {
|
||||
order: ["moonshot"],
|
||||
|
||||
@@ -10,7 +10,10 @@ import {
|
||||
type ToolPayload = {
|
||||
function?: Record<string, unknown>;
|
||||
};
|
||||
|
||||
type XaiTestPayload = Record<string, unknown> & {
|
||||
tools?: Array<{ type?: string; function?: Record<string, unknown> }>;
|
||||
input?: unknown[];
|
||||
};
|
||||
function captureWrappedModelId(params: {
|
||||
modelId: string;
|
||||
fastMode: boolean;
|
||||
@@ -63,10 +66,10 @@ describe("xai stream wrappers", () => {
|
||||
|
||||
it("composes the xai provider stream chain from extra params", () => {
|
||||
let capturedModelId = "";
|
||||
let capturedPayload: Record<string, unknown> | undefined;
|
||||
let capturedPayload: XaiTestPayload | undefined;
|
||||
const baseStreamFn: StreamFn = (model, _context, options) => {
|
||||
capturedModelId = String(model.id);
|
||||
const payload: Record<string, unknown> = {
|
||||
const payload: XaiTestPayload = {
|
||||
reasoning: { effort: "high" },
|
||||
tools: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user