test: tighten brave response duration assertion · openclaw/openclaw@d8daa71
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -640,11 +640,16 @@ describe("brave web search provider", () => {
|
640 | 640 | mode: "web", |
641 | 641 | status: 200, |
642 | 642 | ok: true, |
643 | | -durationMs: expect.any(Number), |
644 | 643 | }), |
645 | 644 | ], |
646 | 645 | ]), |
647 | 646 | ); |
| 647 | +const responseLog = loggerInfoMock.mock.calls.find( |
| 648 | +([message]) => message === "brave http response", |
| 649 | +); |
| 650 | +const responsePayload = responseLog?.[1] as { durationMs?: unknown } | undefined; |
| 651 | +expect(typeof responsePayload?.durationMs).toBe("number"); |
| 652 | +expect(responsePayload?.durationMs).toBeGreaterThanOrEqual(0); |
648 | 653 | expect(JSON.stringify(loggerInfoMock.mock.calls)).not.toContain("brave-test-key"); |
649 | 654 | expect(JSON.stringify(loggerInfoMock.mock.calls)).not.toContain("X-Subscription-Token"); |
650 | 655 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。