test: tighten matrix http client request assertion · openclaw/openclaw@ea27bce
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
File tree
extensions/matrix/src/matrix/sdk
| Original file line number | Diff line number | Diff line change |
|---|
@@ -48,18 +48,21 @@ describe("MatrixAuthedHttpClient", () => {
|
48 | 48 | }); |
49 | 49 | |
50 | 50 | expect(result).toEqual({ ok: true }); |
51 | | -expect(performMatrixRequestMock).toHaveBeenCalledWith( |
52 | | -expect.objectContaining({ |
53 | | -method: "GET", |
54 | | -endpoint: "https://matrix.example.org/_matrix/client/v3/account/whoami", |
55 | | -allowAbsoluteEndpoint: true, |
56 | | -ssrfPolicy: { allowPrivateNetwork: true }, |
57 | | -dispatcherPolicy: { |
58 | | -mode: "explicit-proxy", |
59 | | -proxyUrl: "http://proxy.internal:8080", |
60 | | -}, |
61 | | -}), |
62 | | -); |
| 51 | +expect(performMatrixRequestMock).toHaveBeenCalledWith({ |
| 52 | +homeserver: "https://matrix.example.org", |
| 53 | +accessToken: "token", |
| 54 | +method: "GET", |
| 55 | +endpoint: "https://matrix.example.org/_matrix/client/v3/account/whoami", |
| 56 | +qs: undefined, |
| 57 | +body: undefined, |
| 58 | +timeoutMs: 5000, |
| 59 | +ssrfPolicy: { allowPrivateNetwork: true }, |
| 60 | +dispatcherPolicy: { |
| 61 | +mode: "explicit-proxy", |
| 62 | +proxyUrl: "http://proxy.internal:8080", |
| 63 | +}, |
| 64 | +allowAbsoluteEndpoint: true, |
| 65 | +}); |
63 | 66 | }); |
64 | 67 | |
65 | 68 | it("returns plain text when response is not JSON", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。