fix(core): handle partial listing data

This commit is contained in:
2026-04-28 21:34:45 -04:00
parent 7966073bf8
commit 3fe5fdb63f
10 changed files with 150 additions and 124 deletions

View File

@@ -8,7 +8,7 @@ describe("MCP protocol cookie inputs", () => {
beforeEach(() => {
global.fetch = mock(() =>
Promise.resolve(new Response(JSON.stringify([]), { status: 200 })),
) as typeof fetch;
) as unknown as typeof fetch;
});
afterEach(() => {
@@ -48,7 +48,7 @@ describe("MCP protocol cookie inputs", () => {
}),
);
const calledUrl = (global.fetch as ReturnType<typeof mock>).mock
const calledUrl = (global.fetch as unknown as ReturnType<typeof mock>).mock
.calls[0]?.[0];
expect(String(calledUrl)).toContain("/facebook?q=laptop");
expect(String(calledUrl)).not.toContain("cookies=");
@@ -59,7 +59,7 @@ describe("MCP protocol unstableFilter", () => {
beforeEach(() => {
global.fetch = mock(() =>
Promise.resolve(new Response(JSON.stringify([]), { status: 200 })),
) as typeof fetch;
) as unknown as typeof fetch;
});
afterEach(() => {
@@ -103,7 +103,7 @@ describe("MCP protocol unstableFilter", () => {
}),
);
const calledUrl = (global.fetch as ReturnType<typeof mock>).mock
const calledUrl = (global.fetch as unknown as ReturnType<typeof mock>).mock
.calls[0]?.[0];
expect(String(calledUrl)).toContain("unstableFilter=true");
});
@@ -127,7 +127,7 @@ describe("MCP protocol unstableFilter", () => {
}),
);
const calledUrl = (global.fetch as ReturnType<typeof mock>).mock
const calledUrl = (global.fetch as unknown as ReturnType<typeof mock>).mock
.calls[0]?.[0];
expect(String(calledUrl)).toContain("unstableFilter=true");
});
@@ -151,7 +151,7 @@ describe("MCP protocol unstableFilter", () => {
}),
);
const calledUrl = (global.fetch as ReturnType<typeof mock>).mock
const calledUrl = (global.fetch as unknown as ReturnType<typeof mock>).mock
.calls[0]?.[0];
expect(String(calledUrl)).toContain("unstableFilter=true");
});