mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-01 14:53:34 +00:00
test(google): use real responses in Gemini search fixture
This commit is contained in:
@@ -10,10 +10,9 @@ type TestModelProviderConfig = NonNullable<
|
||||
|
||||
function installGeminiFetch() {
|
||||
const mockFetch = vi.fn((_input?: RequestInfo | URL, _init?: RequestInit) =>
|
||||
Promise.resolve({
|
||||
ok: true,
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
Promise.resolve(
|
||||
new Response(
|
||||
JSON.stringify({
|
||||
candidates: [
|
||||
{
|
||||
content: { parts: [{ text: "Grounded answer" }] },
|
||||
@@ -23,7 +22,8 @@ function installGeminiFetch() {
|
||||
},
|
||||
],
|
||||
}),
|
||||
} as Response),
|
||||
),
|
||||
),
|
||||
);
|
||||
vi.stubGlobal("fetch", withFetchPreconnect(mockFetch));
|
||||
return mockFetch;
|
||||
|
||||
Reference in New Issue
Block a user