test(google): narrow web search fake timers · openclaw/openclaw@fe7d13c
vincentkoc
·
2026-05-22
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -401,7 +401,7 @@ describe("google web search provider", () => {
|
401 | 401 | }); |
402 | 402 | |
403 | 403 | it("passes freshness to Gemini Google Search grounding as a time range", async () => { |
404 | | -vi.useFakeTimers(); |
| 404 | +vi.useFakeTimers({ toFake: ["Date"] }); |
405 | 405 | // Use a wall-clock-realistic moment with non-zero milliseconds; the helper |
406 | 406 | // must strip them to avoid Gemini's "Granularity of nano is not supported". |
407 | 407 | vi.setSystemTime(new Date("2026-04-15T12:00:00.123Z")); |
@@ -434,7 +434,7 @@ describe("google web search provider", () => {
|
434 | 434 | }); |
435 | 435 | |
436 | 436 | it("strips sub-second precision from freshness timestamps so Gemini accepts them", async () => { |
437 | | -vi.useFakeTimers(); |
| 437 | +vi.useFakeTimers({ toFake: ["Date"] }); |
438 | 438 | // "now" with non-zero milliseconds. Without stripping, toISOString() emits |
439 | 439 | // "2026-04-15T12:00:00.123Z", which Gemini's google_search.time_range_filter |
440 | 440 | // rejects with "Granularity of nano is not supported". |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。