test(openrouter): stabilize music timeout clamp assertion · openclaw/openclaw@3f54d15
steipete
·
2026-06-01
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -208,6 +208,8 @@ describe("openrouter music generation provider", () => {
|
208 | 208 | }); |
209 | 209 | |
210 | 210 | it("caps oversized OpenRouter music stream timeouts", async () => { |
| 211 | +vi.useFakeTimers(); |
| 212 | +vi.setSystemTime(1_000); |
211 | 213 | const timeoutSpy = vi.spyOn(globalThis, "setTimeout"); |
212 | 214 | try { |
213 | 215 | postJsonRequestMock.mockResolvedValue({ |
@@ -231,6 +233,7 @@ describe("openrouter music generation provider", () => {
|
231 | 233 | expect(streamTimeoutMs).toBeLessThanOrEqual(MAX_TIMER_TIMEOUT_MS); |
232 | 234 | } finally { |
233 | 235 | timeoutSpy.mockRestore(); |
| 236 | +vi.useRealTimers(); |
234 | 237 | } |
235 | 238 | }); |
236 | 239 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。