mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 03:20:42 +00:00
test: tighten brave response duration assertion
This commit is contained in:
@@ -640,11 +640,16 @@ describe("brave web search provider", () => {
|
||||
mode: "web",
|
||||
status: 200,
|
||||
ok: true,
|
||||
durationMs: expect.any(Number),
|
||||
}),
|
||||
],
|
||||
]),
|
||||
);
|
||||
const responseLog = loggerInfoMock.mock.calls.find(
|
||||
([message]) => message === "brave http response",
|
||||
);
|
||||
const responsePayload = responseLog?.[1] as { durationMs?: unknown } | undefined;
|
||||
expect(typeof responsePayload?.durationMs).toBe("number");
|
||||
expect(responsePayload?.durationMs).toBeGreaterThanOrEqual(0);
|
||||
expect(JSON.stringify(loggerInfoMock.mock.calls)).not.toContain("brave-test-key");
|
||||
expect(JSON.stringify(loggerInfoMock.mock.calls)).not.toContain("X-Subscription-Token");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user